View Full Version : Error on exiting Installer
2nd September 2009, 14:05
I'm getting an Application Error when Installer exists. Error message says: "Instruction at "0x01a01c51" referenced memory at "0x00000004". The memory could not be "read". Click OK to terminate the program.
Installer does everything it is supposed to, but this annoying message pops up in the end. Any pointers as to what I should be looking for or check to get rid of the error?
4th September 2009, 11:16
I have now identified when this runtime error occurs. It happens every time I use a specific call to an external DLL through System::Call. Call has following signature:
bool APIENTRY GetSomeStuff( char *Buffer, int BufferLength )
Call from NSIS is:
System::Call "Mydllfilename::GetSomeStuff(t .r7, i 30) i .r0"
I have experimented with different ways/parameters in the System::Call, but nothing seems to make a difference. The call produces the desired results, but for some reason I always get an Application error when Installer exits. The error does not occur if this call is not made. Any ideas as to why this happens? A bug in the dll? The same dll has been earlier used with InstallShield without issue. Also, it seems to work fine when called otherwise outside of NSIS.
4th September 2009, 14:48
InstallShield? is this function cdecl by any chance? Or to put it another way, what is APIENTRY defined to?
You could try adding the cdecl flag to the system call, see the system readme for more info
4th September 2009, 15:18
APIENTRY is defined in windef.h:#define WINAPI __stdcall
#define APIENTRY WINAPI
4th September 2009, 15:50
You you have the source to this thing, you could try to replace the body of the function with something simple like
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.