Bugzilla – Bug 312552
P\Invoke cannot implement attriube DllImportAttribute.SetLastError
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by hfhe@stryon.com 2003-07-06 21:38:03 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: Call unmanaged function with P\Invoke, and assigned attriube DllImportAttribute.SetlastError, but cannot implement attriube DllImportAttribute.SetLastError Steps to reproduce the problem: 1. Declare a funtion prototype to call unmanaged library 2. Assigned attribute DllImportAttribute.SetlastError 3. Call this function Actual Results: The last error before MessageBox is called: 0 Calling MessageBox with wrong parameters... Call result: 24271400 The last error after MessageBox is called: 0 Error message: The operation completed successfully. Expected Results: The last error before MessageBox is called: 126 Calling MessageBox with wrong parameters... Call result: 0 The last error after MessageBox is called: 1438 Error message: Invalid message box style. How often does this happen? Each time Additional Information: ---- Additional Comments From hfhe@stryon.com 2003-07-06 21:38:23 MST ---- Created an attachment (id=164781) Source file ---- Additional Comments From vargaz@freemail.hu 2003-10-13 12:14:19 MST ---- Fixed in CVS. Imported an attachment (id=164781) Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>Windows2000</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".