ต้องขอโทษคุณpandula ด้วยนะครับ ที่ผมเอาcode มาใช้โดยไม่ได้ขออณุญาต
varavut: ต้องขอโทษคุณpandula ด้วยนะครับ ที่ผมเอาcode มาใช้โดยไม่ได้ขออณุญาต
ไม่เป็นไรเลยครับผม ยินดีมากๆ ครับผม
แล้วFunc กับAction นี่ต่างกันอย่างไรครับ รบกวนช่วยอธิบายหน่อยครับ ขอบคุณครับ
Func หมายถึง Function ครับ Func<int, int, int> คือ Function รับ int 2 ตัว return int
Action คือ Function Return Void ครับ Action<int, int, int> คือ Function รับ int3 ตัว ไม่ return อะไรเลย
coreadmin:Func หมายถึง Function ครับ Func<int, int, int> คือ Function รับ int 2 ตัว return intAction คือ Function Return Void ครับ Action<int, int, int> คือ Function รับ int3 ตัว ไม่ return อะไรเลย
ขอบคุณครับ
คือข้อนี้ยังไงก็ต้องใช้ delegate ใช่ไหมครับ
แวะมาตอบอีกทีคับ อิ อิ
When working with the .NET Compact Framework and using P/Invoke on a native function, this exception may be thrown if:- The declaration in managed code is incorrect.- The .NET Compact Framework does not support what you are trying to do.- The DLL names are mangled on export.- In such a case, check:- For any violations of the .NET Compact Framework P/Invoke restrictions.- For any arguments that require pre-allocated memory. If these exist, you should pass a reference to an existing variable.- That the names of the exported functions are correct. This can be verified with DumpBin.exe.- That you are not attempting to pass too many arguments.
เป็นคำตอบสุดท้ายคับ
giffy2499: แวะมาตอบอีกทีคับ อิ อิ When working with the .NET Compact Framework and using P/Invoke on a native function, this exception may be thrown if:- The declaration in managed code is incorrect.- The .NET Compact Framework does not support what you are trying to do.- The DLL names are mangled on export.- In such a case, check:- For any violations of the .NET Compact Framework P/Invoke restrictions.- For any arguments that require pre-allocated memory. If these exist, you should pass a reference to an existing variable.- That the names of the exported functions are correct. This can be verified with DumpBin.exe.- That you are not attempting to pass too many arguments. เป็นคำตอบสุดท้ายคับ
ถ้าเปลี่ยนอันนี้เป็น Action และใช้ C#3.0 ก็ถูกเลยคับ