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 C dll


3 replies to this topic

Dyerald

Dyerald
  • Members
  • 43 posts

Posted 02 October 2001 - 07:54

Hi,

Im using IPWI 2.03 and my project needs to call a C programmed dll that checks the registration number. The C dll's declaration was :

int CheckRegNum(char *RegNum,char *PrdName,int *runtime,int *lines,int *registered,char *CompName,int *digital, int *sentinel, int *version);

I read about calling the StreamFromBinaryFile function and i used this also in my project. I followed every steps that I read about calling Dll using script. I made an function in my script that calls the StreamFIleFromBinary before calling the UseDll function. Then I put it on a custom action CheckRegNo. On my CustomerInformation dialog I included this custiom action on the Next button event using DoAction. When I builtd the project I got a warning like this:

** Warning -4095: Calling DoAction from a control event on an InstallScript custom action may not work in all cases, especially if you are using SOURCEDIR, TARGETDIR, PreShowComponentDlg, or MsiDoAction in the script.  Control Next, dialog CustomerInformation, argument CheckRegNo.

When I run the setup the CheckRegNo custom action seems to work fine but it didnt return any return value. This return value is very important because ather functions on my setup depends on this like dialogs to be shown or not. Theres no error in calling UseDll and everything except that warning when i buld the project. I dont know whats the problen my custom action and what the meaning of the warning. What should I do??? Did I forgot something else??? Any idea???

Pls help I really need this in my project. I would very grateful for your help.

Thanks in advance,
Dyerald


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 October 2001 - 08:24

I think you can ignore this warning.
However I wonder why you are using a script to call the DLL? Why not create a custom action of type "call function in standard dll"?

Dyerald

Dyerald
  • Members
  • 43 posts

Posted 02 October 2001 - 09:04

Hi Sir Stefan,

Thanks for your reply. I did not use standard dll action 'coz Im not really familliar in using it. Anyways can you teach me how? Im kinda confused in using standard dll type of custom action.

In addtion to my last post, I the custom action works fine.. it doesn't have any internal error and evrything but when I click the next button, the setup was aborted. What possible coz of this problem? When I tried to display the return value of the dll. the message box doesn't appear. I still Dont know why the setup wqas aborted.

Thanks in advance for your help. I really appreciate it .

Dyerald


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 October 2001 - 16:48

This could mean that the dll prototpye is wrong, or the dll function name in the dll is mangled.

Did you read the help about standard dll functions, and try the ca wizard?