l0k1
5th May 2008 10:50 UTC
Custom Dll unstable behavior
I've done a custom dll (plugin) for NSIS and i'm experiencing strange behavior : the DLL work fine on every computer until i execute it (within an installer) under a Virtual machine.
I'm using Virtual PC for this.
It seems that the stack doesn't work and the plugin returns parameters send in the call.
For example:
myDLL::MyFunction param1 param2 ...
Pop $0
Pop $1
Messagebox MB_OK "$0$1"
Returns:
param1, param2, ....
in place of : "OK", myReturnedValue
Any idea ?
kichik
5th May 2008 19:11 UTC
It's probably failing to load due to missing dependencies. Compile it as a static DLL. If you're on a recent version of Visual Studio, you're probably missing MSVCR80.DLL. If not, it's probably a debug build and you're missing MSVCRTD.DLL.
l0k1
6th May 2008 13:28 UTC
In fact, it was a compil option error.
I changed DLL Multithread (/MD) to Multithread (/MT) and it works fine.
It could be a good idea if there was a help file explaining how to build a NSIS DLL (with compiler option too).
Thanks for the help anyway.
kichik
6th May 2008 18:05 UTC
That's not a compile error, that's exactly compiling it as a static DLL. Instead of depending on libc in an external DLL, you're depending on libc statically.
All the required complier options are configured in exdll.dsp.