Page 1 of 1

Call DLL Function, pointer variable

Posted: Wed Jan 26, 2011 2:00 am
by jenlin0703
Hello,

I have a custom action DLL.
I am currently call DLL function using installscript of InstallShield but now I want to call DLL function by MSICode.
I use "Call DLL Function" of MSICode, but I get the error: "EXTERNALEXCEPTION."

The following code does not work :"(

Code: Select all

~InstallAware Clipboard Data~
~Call DLL Function~
~{AF055A87-7597-4980-906D-19516F0787CC}~
~$SUPPORTDIR$\ProductPassLite.dll,PASSCheckCode,long,nTemp,"pointer to string",$szSN$,"pointer to string",$szName$,"pointer to string",$PASSInfo$,$~
~mIDEFunc.dll\mEXEFunc.dll~
~Set Variable~
~{0A676E66-F8B3-4C94-8CE0-F6E63B77C92E}~
~szName$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{4ACFDCA0-A0A5-45FD-9AB0-76DCBBDB63F5}~
~szSN$MYAH$MYAH$FALSE~
~27D8W-5RNLZ-WEX5L-AECE7-WF~
~Set Variable~
~{F858E7AD-E4F4-4FA4-A473-5A7C1A444496}~
~nLanguageID$MYAH$MYAH$FALSE~
~~
~Set Variable~
~{A1077F87-E59F-47C3-B9CB-AE0A0D5FCFF4}~
~nOEMCode$MYAH$MYAH$FALSE~
~~
p.s.
(1) Type definition of DLL

EPassResult PASSCheckCode( const char* pszSerialCode, const char* pszName, PASSProductInfo* pkInfo );

(2) Data structure definition in installscript
typedef SNProductInfo
begin
long nLanguageID
long nOEMCode;
end;

SNProductInfo PASSInfo;

(3) call DLL in installscript
prototype INT ProductPassLite.PASSCheckCode(STRING,STRING,SNProductInfo POINTER);

nTmp=ProductPassLite.PASSCheckCode(szSN,szName,&PASSInfo);
gnOEMCode = PASSInfo.nOEMCode;
gnLangID = PASSInfo.nLanguageID;

I want get the value of nTmp, gnOEMcODE and gnLangID.

What is the correct way of calling?
any help would be appreciated...
Thanks in advance.

Jen

Re: Call DLL Function, pointer variable

Posted: Wed Jan 26, 2011 11:04 am
by giaviv
Dear Jen,

That means that an exception was thrown in your DLL. What language was your DLL written in?

Re: Call DLL Function, pointer variable

Posted: Wed Jan 26, 2011 8:21 pm
by jenlin0703
Hi giaviv,

I wrote this DLL in C language.
The DLL succeeded in installscript, but failed in InstallAware.
I think the problem is parameter of passed to the function, but I can't find the error...

Thanks!!

Jen

Re: Call DLL Function, pointer variable

Posted: Wed Jan 26, 2011 8:51 pm
by giaviv
Dear jen,

Could you send your DLL and your script to support at installaware.com?