C# and DLL calling
-
Hi, I seem to have a problem with a debug version of a DLL that i am calling. It enteres the function OK and goes to the end but when the function returns it tries to store the return value of the functoin in the register ESI from EDX. Visual C# then throws an access violation error. It works fine in release mode and uses the same registers. Has anybody seen this before and know how to resolve the issue. Thanks Ceri
-
Hi, I seem to have a problem with a debug version of a DLL that i am calling. It enteres the function OK and goes to the end but when the function returns it tries to store the return value of the functoin in the register ESI from EDX. Visual C# then throws an access violation error. It works fine in release mode and uses the same registers. Has anybody seen this before and know how to resolve the issue. Thanks Ceri
Ceri wrote: Has anybody seen this before and know how to resolve the issue. Not exactly but I have had similar problems before, there are often vast differences between debug and release versions that you don't see. For example, I've written DLLs for Windows Installer using VC++ which work fine in debug mode and not in release mode. When I switched the release mode optimisation off, it worked fine. If possible, it's worth looking at the differences in the commandline options for the DLL in release and debug mode and adjusting them until they both act the same way. Then at least you'll know what is causing the problem. Paul Why don't you take a good look at yourself and describe what you see - Led Zeppelin, Misty Mountain Hop
-
Hi, I seem to have a problem with a debug version of a DLL that i am calling. It enteres the function OK and goes to the end but when the function returns it tries to store the return value of the functoin in the register ESI from EDX. Visual C# then throws an access violation error. It works fine in release mode and uses the same registers. Has anybody seen this before and know how to resolve the issue. Thanks Ceri
Don't see the relation with C#, appart the fact C# is hosting your client. Try compiling the DLL by changing the signature of methods (__cdecl, __fastcall, ...) : Project settings / C/C++ tab / code generation / calling convention. From what I remember, the return value is always stored in EAX.
How low can you go ?
(MS retrof_u_ck)