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

"DLL function call crashed"


1 reply to this topic

dalbuschat

dalbuschat
  • Members
  • 1 posts

Posted 04 August 2006 - 15:53

Hello!

I am desperately searching for documentation on writing DLL functions properly. There seems to be *nothing* included in the online help, except for a few topics on writing prototypes and specifying the calling convention. But nothing about what InstallShield-Types map to which C-types.

I have multiple DLL functions in my project, and multiple problems :) I had to guess how the C-prototype has to look like. Is there a difference between BYREF STRING and BYVAL STRING for the DLL-function? Some of the functions crash on the "return" statement, I debugged another that crashed on a strlen() which was called on one of the parameters. Additionally, I'm altering a string value that is passed by reference (because I don't know how I can properly return strings and how allocating/deallocating is handled within InstallShield) -- is this ok? I declared the string as STRING text[1024].
I can not create a testcase, because the testcases all work. It's probably dependent on what I do within the function. Of course I tried the DLL's functions first from within a test application framework.

I'm currently struggling with the following function.
The script's prototype looks like this:
CODE
prototype cdecl BOOL InstallTools.FindIniInPath(BYREF STRING);

and the C(++) function looks like this:
CODE
extern "C" BOOL DLLEXPORT FindIniInPath(char *path)


The function crashes when I call strlen(path).
I would be really grateful if somebody could help me figuring out my problems, since I'm somewhat clueless as what to try next.

Regards,
Daniel Albuschat

MrSmersh

MrSmersh
  • Full Members
  • 48 posts

Posted 04 August 2006 - 16:51

Try
prototype cdecl BOOL InstallTools.FindIniInPath(POINTER);

I will look in my code to be sure(because for sure I’ve done it), but I'm 90% positive that is how to do it.