Installshield Serial DLL 問題 |
答題得分者是:wameng
|
gordenhao
一般會員 發表:3 回覆:2 積分:1 註冊:2005-04-06 發送簡訊給我 |
請問一下
我用 Delphi 寫 DLL 給 Installshield Express 10 做續號認證
但是在 InsatllShield 那端一值出錯
不知道是哪邊有問題?
可否幫忙看一下 已經測試過回傳值用 Integer 也是一樣不行
用 showmessage 測試過有時候傳入值有三個有時候有四個
所以怪怪的
錯誤訊息為 >> The DLL being called encountered a problem. unit Unit1; interface
uses Dialogs; function check_serial(temp1:pchar):pchar;stdcall;
implementation function check_serial(temp1:pchar):pchar;stdcall;
begin
if temp1 <> '123' then
begin
check_serial :='0'; end
else
begin
check_serial:='1'; end; end; end.
|
gordenhao
一般會員 發表:3 回覆:2 積分:1 註冊:2005-04-06 發送簡訊給我 |
|
wameng
版主 發表:31 回覆:1336 積分:1188 註冊:2004-09-16 發送簡訊給我 |
CallDLLFx (szDLL, szFunction, lvValue, svValue); Description The CallDLLFx function calls a function within a specified DLL. That function must use the following fixed definition, where hwnd is the main window handle for the main InstallShield window: LONG APIENTRY YourFunction (HWND hwnd, LPLONG lpIValue, LPSTR lpszValue); Parameters szDLL
Specifies the fully qualified filename of the DLL that contains the function to execute.
szFunction
Specifies the name of the function in the DLL specified in szDLL.
IvValue
Specifies a long integer variable to pass by reference to the DLL function.
svValue
Specifies a string variable to pass to the DLL function. installShield 6.3
|
gordenhao
一般會員 發表:3 回覆:2 積分:1 註冊:2005-04-06 發送簡訊給我 |
Dear wameng
感謝您的回答
以下是我查到的資料(在 installshield express 10的 help)
參數的數量跟您的不太一樣
可能是版本問題吧
anyway , thanks for your help...^^ InstallShield requires a precise prototype for an entry-point function in a DLL called as the result of a custom action. InstallShield Software Corporation does not provide technical support for Windows programming or DLL debugging. You are responsible for correctly writing any DLL functions. Prototype your custom DLL functions as shown below. Any variation in return type or type and number of parameters can cause the custom action to fail. LONG WINAPI Foo(HWND, LPTSTR , LPTSTR, LPTSTR, LPTSTR);
InstallShield uses the function prototype to pass the following information to your DLL: Parameter 1 passes the installation's window handle. This parameter always returns NULL.
Parameter 2 passes the source directory [SRCDIR].
Parameter 3 passes the support directory [SUPPORTDIR].
Parameter 4 passes the main target directory [INSTALLDIR].
Parameter 5 passes the database directory [DATABASEDIR].
If you are prototyping a custom action to handle the serial number entered in the Customer Information run-time dialog, then Parameter 4 will be the serial number. The body of your DLL function can do just about anything you want. Obviously, you may have good use for the values passed to the function by InstallShield. Your DLL function must return a value of type LONG as a state flag signaling the completion of the routine. If your function returns zero, the installation exits. If it returns any other value, the installation continues.
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |