9
95927
Unregistered / Unconfirmed
GUEST, unregistred user!
C 头文件定义:<br> <br>typedef unsigned int UINT4;<br>typedef unsigned char UCHAR;<br><br>C 头文件函数声明:<br><br>int CreateKeyFromPassword(ATTRIB_TYPE keyAttrib,<br> UCHAR *inPassword,<br> UINT4 passwordLen,<br> UCHAR *outKey,<br> UINT4 *outKeyLen);<br><br>同志们先看看下面转的对不对,要说明的是outKey,outKeyLen是要返回的<br>CreateKeyFromPassword看函数返回的值(是不是调用成功)来处理outKey,outKeyLen的<br><br>以下是我转的Delphi 接口声明(不知道对不对): <br><br> function CreateKeyFromPassword(keyAttrib: ATTRIB_TYPE;<br> inPassword: PChar;<br> passwordLen: Word;<br> outKey: PChar;<br> outKeyLen: PWord): Integer; cdecl; external MyDll_Name;<br><br>Delphi 调用:<br><br>var<br> TempInt: Integer;<br> Password, Key: string;<br> KeyLen: Word;<br><br>begin<br> TempInt := CreateKeyFromPassword(ATTRIB_SDBI_KEY,<br> PChar(Password), Length(Password), PChar(Key), @KeyLen);<br> if RTN_OK <> TempInt then<br> begin<br> ShowMessage('生成密钥失败, 错误代码:[ ' + IntToStr(TempInt) + ' ]');<br> end;<br><br>end;<br><br>程序运行是没有错,可就是调用失败