Hi all,
I'm new to NSIS, and try to wrapper the custom control written in C++ as a dll/plugin and call the related api from nsis script, however, i do notice that in the nsis example, the InstallOptions plugin which have a C++ signature just like
extern "C" void __declspec(dllexport) dialog(HWND hwndParent, int string_size,
char *variables, stack_t **stacktop)
however, it just called in a script(testlink.nsi) like
InstallOptions::dialog "$PLUGINSDIR\test.ini"
Why the signature doesn't match with their counterpart? What have happened in the NSIS source code underbeneath?
Thanks
Why the signature of NSIS plugin doesn't match the one in the script?
5 posts
Actually the full signature now is:
Have you had a look at the System plug-in? You can call normal DLLs with that; would save you converting your one to an NSIS plug-in.
Stu
(backwards compatible). As for your question, the parameters you pass in the script are not passed as parameters to the plug-in function. Instead they are passed via the NSIS stack. You use popstring to grab them.extern "C" void __declspec(dllexport) name(HWND hWndParent, int string_size, TCHAR* variables, stack_t** stacktop, extra_parameters* extra)
Have you had a look at the System plug-in? You can call normal DLLs with that; would save you converting your one to an NSIS plug-in.
Stu
You are missing a __cdecl in there...Originally Posted by Afrow UK View PostActually the full signature now is
You probably know this already but __cdecl is the default calling convention so you don't have to specify it.
Edit: Unless using msbuild with /Gr or /Gz.
Stu
Edit: Unless using msbuild with /Gr or /Gz.
Stu
Even if cdecl is the default it should still be a part of the signature when posted in public. IMHO stdcall produces smaller and faster code, everyone should be using it on Windows.