dc_dweller
3rd May 2010 21:28 UTC
Trying to write a Plugin in C/C++
Hi all,
The Examples include a simple plugin with the function
void __declspec(dllexport) myFunction(HWND hwndParent, int string_size,
char *variables, stack_t **stacktop,
extra_parameters *extra)
However I could not find .nsi file that calls this function. So how do you call a function like that? No matter what I try I get the error
"Invalid command: InstallHelper::myFunction"
(InstallHelper.dll is the what my plugin DLL is called, and I placed it in the \Plugins folder.)
Thanks in advance.
Afrow UK
3rd May 2010 22:01 UTC
What are you building with? That is the standard function definition for plug-in functions. You do not pass any of those arguments to the function in NSIS script - those are used by NSIS itself. You must use the popstring()/popint() to read parameters (i.e. from the stack).
Check the compiler output to check which plug-ins have been loaded. Is InstallHelper listed?
Stu
Anders
3rd May 2010 22:07 UTC
When you compile a nsis script, makensis will list all of the plugins and their exported functions at the beginning of its output, make sure your exported function has the name you expect (Hint: export "C" and __cdecl)