I'm using ISDev7.01 and I have a standard project that calls a dll function that check the registration number on the CustomerInformation dialog. First I define the dll on the binary table on the Direct editor like this:
Name = REGNUM
ISBuildSourcePath = D:\ProjFiles\VoxtronCTI\regnum.dll
then I made a function like this:
prototype NUMBER regnum.CheckRegNumExt2(BYREF STRING, BYREF STRING, BYREF NUMBER, BYREF NUMBER, BYREF NUMBER, BYREF STRING, BYREF NUMBER, BYREF NUMBER, BYREF NUMBER);
export prototype CheckRegistrationNo(HWND, STRING, STRING, STRING,STRING);
function CheckRegistrationNo(hMSI, svRegNo1, svRegNo2, svRegNo3, svCompany)
STRING szFileName;
STRING szRegNo, svPrd, szReturn;
NUMBER nReturn, nLines, nReg, nE1, nSentinel, nRegVersion, nRuntime;
POINTER pt1;
NUMBER nval;
begin
szFileName = "D:\\ProjFiles\\VoxtronCTI\\regnum.dll";
if(UseDLL(szFileName) < 0) then
MessageBox("UseDLL fail", SEVERE);
return ERROR_INSTALL_FAILURE;
else
MessageBox("UseDll succeeded", INFORMATION);
endif;
if ( StrLength(svRegNo3) != REQ_LENGTH1) then
return FALSE;
endif;
pt1 = &nval;
MsiGetProperty(hMSI,szProperty,svRetProp,pt1);
svPrd = svRetProp;
szRegNo = svRegNo1 + "-" + svRegNo2 + "-" + svRegNo3;
nReturn=CheckRegNumExt2(szRegNo,svPrd,nRuntime,nLines,nReg,svCompany,nE1,nSentinel,nRegVersion);
SprintfBox(INFORMATION, "return", "%d", nReturn);
if(nReturn = -1) then
MessageBox("This registration number is for Windows 95 only.",INFORMATION);
return FALSE;
elseif(nReturn = -2) then
MessageBox("This registration number is for Windows NT only.",INFORMATION);
return FALSE;
elseif(nReturn = -0) then
MessageBox("Invalid registration number!",INFORMATION);
return FALSE;
elseif(nReturn = -3) then
MessageBox("Error in registration information. Check the registration number and company name.",INFORMATION);
return FALSE;
elseif(nReturn = -5) then
MessageBox("Registration number is valid only for an earlier version of Telebutler!",INFORMATION);
return FALSE;
endif;
UnUseDLL(szFileName);
end;
The UseDll works fine but when I run my project I encounter an unhandled exception error:
Error: 0x80040703
Description : Failed to find dll function regnum.CheckRegNumExt2
and then my project was aborted. Why is this happened? Any idea?? Does anybody know how to call a dll function other than this method??? What am I going to do?? Please I really need to make this work as soon as possible.
In addtion the dll I am using was a C programmed dll and i only have the dll file because the dll was programmed by another person and the function declaration of the dll was like this:
int CheckRegNumExt2(char *RegNum,char *app_name,int *runtime,int *lines,int *registered,char *name, int *digital, int *sentinel, int *version);
Please I realy need help. Anybody has an idea on how to call this function???
Thanks in advance,
Dyerald
(Edited by Dyerald at 9:09 am on Nov. 19, 2001)