Archive: first Custom DLL problems


first Custom DLL problems
When compiling my script, it fails saying my plugin dll call is invalid.

I have compiled a custom dll using the exdll.cpp and .h as my base. This is my function signature:
void __declspec(dllexport) IsValidNumberPattern(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra)

I basically took the myFunction and renamed it and provided my own code. I also tried using extern "C" on the function since some other plugin source code used that.

I placed the DLL in the NSIS/Plugins directory.
Added this to my script before any functions:
ReserveFile "${NSISDIR}\Plugins\NumberPatternVerifier.dll"

And in a custom page leave callback this throws "invalid command" during compile:
NumberPatternVerifier::IsValidNumberPattern /NOUNLOAD "419518307"

The name of my dll is:
NumberPatternVerifier.dll

Not sure what I'm doing wrong. One thing I did change is this declaration:
/*HINSTANCE */ HANDLE g_hInstance;
It was giving a compile error due to failure to cast in main from a HINSTANCE to a HANDLE if I compiled in release mode.

Calling convention is set to __cdecl (/Gd)


Sorry, nevermind, again... I always find a solution 30 seconds after posting after an hour of already messing with it on my own.

My DLL wasn't copying over everytime I rebuilt after making changes to try and fix the problem. Apperently something I did in the project settings or the extern fixed it. Once I remember to copy it again it started working.