Old 8th March 2018, 23:35   #1
sifadil
Junior Member
 
Join Date: Mar 2018
Posts: 2
Understanding a user-made plugin function's prototype

Hello.
I was looking through the extdll example in order to create my own plugin. A plugin's function should have the following prototype :
code:
void __declspec(dllexport) myFunction(HWND hwndParent, int string_size, LPTSTR variables, stack_t **stacktop, extra_parameters *extra, ...)

I was able to tell what every parameter is for except the parameter variables. In the case of the extdll example, variables contains the same value as $0 which is shown in a message box by this example.
So, I'm wondering why would I need this parameter if i can use getuservariable() to get Registers values.
Thanks.
sifadil is offline   Reply With Quote
Old 9th March 2018, 01:16   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,926
The init macro you need in a function for getuservariable to work uses it. It does not just contain $0, it contains all the variables. $1 starts at +1024 or whatever the string size is.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 9th March 2018, 12:46   #3
sifadil
Junior Member
 
Join Date: Mar 2018
Posts: 2
Ok. I understand now. thanks for the clarification.
sifadil is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump