Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Calling a DLL function from an InstallScript function


1 reply to this topic

bjh

bjh
  • Members
  • 25 posts

Posted 31 May 2001 - 00:16

I had a InstallScript function that called a DLL function and worked well in IS5 and IS6 and it fails to do the same in ISWI

It calls the function like this:

MyDll.MyFunction(...)

and it takes POINTERs as parameters (the DLL function expects "char *" as parameters.

The CA is not deferred, the InstallScript function
calls MsiGetProperty several times before the "fatal" call, but those calls work fine and there is a reference to SRCDIR (also before the "fatal" call) that works fine too.

Upon calling MyDll.MyFunction, the setup exits with "CA return value 3" (if inside the debugger, the debugger immediately exits without notice).

Thanks in advance for any tips.
Jean


bjh

bjh
  • Members
  • 25 posts

Posted 10 June 2001 - 13:44

I forgot to mention that I managed to find what was the problem. It was the calling convention. It seems that in earlier versions of IS, the CDECL was considered default and my scripts were sucessfully calling function in one of my DLLs. Now I read in the documentation that the default is considered STDCALL
(which is good for the windows APIs, but not for custom developed DLLs - like the one I used).

The bottom line: just adding the correct calling convention in the function declaration solved my problem.