参数类型映射(100分)

  • 主题发起人 主题发起人 felee
  • 开始时间 开始时间
F

felee

Unregistered / Unconfirmed
GUEST, unregistred user!
有一个用VC++写的函数:<br>ReadRegString( HKEY &nbsp; strhkey,LPCSTR strSubKey,LPCSTR strKeyName,LPSTR &nbsp;keyValue)<br><br>在DELPHI中如何声明?<br>
 
Pascal &nbsp; &nbsp; C/C++<br><br>shorInt &nbsp; &nbsp; char<br>byte &nbsp; &nbsp; &nbsp; byte,unsigned short<br>SmallInt &nbsp; short<br>Word &nbsp; &nbsp; &nbsp; unsigned short<br>Integer,longint &nbsp; int,long<br>Cardinal,longword &nbsp; &nbsp; unsigned long<br>int64 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _int64<br>Single &nbsp; &nbsp; &nbsp; &nbsp; float<br>double &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double<br>Extnded &nbsp; &nbsp; long double<br>char &nbsp; &nbsp; &nbsp; char<br>widechar &nbsp; &nbsp; &nbsp; &nbsp; wchar<br>ansistring &nbsp; &nbsp; &nbsp; ansistring<br>PCHAR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char<br>pwidechar &nbsp; &nbsp; &nbsp; &nbsp; lpcstr<br>widestring &nbsp; &nbsp; &nbsp; widestring<br>bool &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bool
 
我想知道:<br>有一个用VC++写的函数:<br>ReadRegString( HKEY &nbsp; strhkey,LPCSTR strSubKey,LPCSTR strKeyName,LPSTR &nbsp;keyValue)<br><br>在DELPHI中如何声明?<br>
 
用TRegistry类吧,省事多了.以下是典型运用:<br>uses<br>&nbsp; Registry;<br><br>var<br>&nbsp; Reg: TRegistry;<br>begin<br>&nbsp; Reg:=TRegistry.Create;<br>&nbsp; try<br>&nbsp; &nbsp; Reg.RootKey:=HKEY_LOCAL_MACHINE;<br>&nbsp; &nbsp; if Reg.OpenKeyReadOnly('Software/Microsoft/XXX') then<br>&nbsp; &nbsp; &nbsp; if Reg.ValueExists('YYY') then<br>&nbsp; &nbsp; &nbsp; &nbsp; Result:=Reg.ReadString('YYY');<br>&nbsp; &nbsp; Reg.CloseKey<br>&nbsp; finally<br>&nbsp; &nbsp; Reg.Free<br>&nbsp; end<br>end;
 
我知道DELPHI中的注册表类功能强大,但我想弄明白这个问题,因为以后可能还会遇到<br>类似问题的<br>
 
把vc包装成dll
 
ReadRegString(strhkey:HKEY;strSubKey,strKeyName,keyValue: PChar);<br>就可以了<br>
 
多人接受答案了。
 
后退
顶部