Hi,
I have a problem in interop.
I have a c++ dll that has a function that takes the control handle as input and does some manipulation on the editable field.
// HINSTANCE SetInstanceHandle(HINSTANCE hInstance)
I have a .NET form in which I have a textbox control. Now I import the c++ dll and invoke the function. Now, I pass the textbox control's handle as Control.ControlAccessibleObject .Handle (which returns a IntPtr). This gives me an error quoting "The runtime has encountered a fatal error. The address of the error was at 0x79ef04d2, on thread 0x364. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack."
I dont know what this error imply. I am also afraid that my way of accessing the handle in .NET is wrong.
Please guide me to access this c++ function.
Thanks,
Mani
.NET Development23
|