Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Executing function from dll with parameters (http://forums.winamp.com/showthread.php?t=249337)

bigbluestranger 22nd June 2006 09:20

Executing function from dll with parameters
 
Hi,
I have a following problem:

I'm creating install program and I use some functions from external dll library.If one of my function in dll library has no parameters it works correctly.
But I have to use function with parameter:
void foo(int i)
{
....
};
I do not really know how to call this function from my nsi file(nullsoft installer script).
Please help me.
I'v tried this ways:

VComInstaller::SetMUXPORTNAMERegistryKey 2
VComInstaller::SetMUXPORTNAMERegistryKey $2
VComInstaller::SetMUXPORTNAMERegistryKey "2"

It doesn't work :(

bigbluestranger 22nd June 2006 09:33

I've tried do it this way too:

StrCpy $0 2
System::Call ' VComInstaller::SetMUXPORTNAMERegistryKey(i r0)'

Without good result ;-(.
It doesn't call my function.

Mr Inches 22nd June 2006 11:02

The first version will only work with plug-ins, so your library needs to be expecting parameters to be passed to it by NSIS.

The ExDLL header file (Contrib\ExDLL\ExDLL.h) details how parameters are passed to a plugin and how a plugin can access the stack or NSIS variables. Your library needs to be in the $PLUGINSDIR to work this way too.

The second form only works the other way, if your library is NOT a plug-in and expects to be called like a normal DLL.

Duncan

bigbluestranger 22nd June 2006 11:13

I haven't this file ;-( ExDLL.h
Could You print it or send me marcin.bukowski@NOSPAMgmail.com

Please remove NOSPAM from my email.
Thanks.

bigbluestranger 22nd June 2006 11:17

I found http://www.koders.com/c/fid1ABD22E81...C6E8CE6B1.aspx
but it says me nothing.
Please give me short example.

Afrow UK 22nd June 2006 11:17

It's in the NSIS source distribution which is on the Wiki.

-Stu

bigbluestranger 22nd June 2006 11:31

I have this version but in my Contrib folder are only
5 subfolders and ExDLL doesn't exist.
Additionally i've done search for ExDLL.h file and it doesn't exist too. ;-(

So where is the problem?

bigbluestranger 22nd June 2006 11:34

OK, I found this file, but I don't understand how to call my function with parameters.

Afrow UK 22nd June 2006 12:42

You use the stack to pass it data, using popstring(buff).
You need to use atoi to convert it to an integer if necessary (or use my_atoi which you can find on Google).

-Stu


All times are GMT. The time now is 05:12.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.