请问是{$IFDEF NT5}什么意思?谢谢!(50分)

  • 主题发起人 主题发起人 danliyou
  • 开始时间 开始时间
D

danliyou

Unregistered / Unconfirmed
GUEST, unregistred user!
我在单元中调用了一个winAPI函数:'CryptEnumProviders',出现错误如下:<br>[Error] Unit1.pas(203): Undeclared identifier: 'CryptEnumProviders'<br>谁能帮助我一下?谢谢!
 
这是你标题的问题。解答如下:<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>{$DEFINE MyDefine}<br>{$IFDEF MyDefine}<br>&nbsp; ShowMessage('Have MyDefine');<br>{$ELSE}<br>&nbsp; ShowMessage('Not Have MyDefine');<br>{$ENDIF}<br><br>{$UNDEF MyDefine}<br><br>{$IFNDEF MyDefine}<br>&nbsp; ShowMessage('Not Have MyDefine');<br>{$ENDIF}<br><br>end;<br>
 
把那单元贴出来。
 
条件编译
 
有这个WinApi吗?
 
{$IFDEF NT5}用来指示编译器符合条件才编译<br>CryptEnumProviders在Delphi中没有声明<br>声明如下:<br>interface<br>{$IFDEF UNICODE}<br>function CryptEnumProviders(dwIndex: DWORD; pdwReserved: LPDWORD; dwFlags: DWORD;<br>&nbsp; var pdwProvType: DWORD; pszProvName: LPWSTR; var pcbProvName: DWORD): BOOL; stdcall;<br>{$EXTERNALSYM CryptEnumProviders}<br>{$ELSE}<br>function CryptEnumProviders(dwIndex: DWORD; pdwReserved: LPDWORD; dwFlags: DWORD;<br>&nbsp; var pdwProvType: DWORD; pszProvName: LPSTR; var pcbProvName: DWORD): BOOL; stdcall;<br>{$EXTERNALSYM CryptEnumProviders}<br>{$ENDIF}<br><br><br>implementation<br>{$IFDEF UNICODE}<br>function CryptEnumProviders; external advapi32 name 'CryptEnumProvidersW';<br>{$ELSE}<br>function CryptEnumProviders; external advapi32 name 'CryptEnumProvidersA';<br>{$ENDIF}<br><br>
 
请问如何将函数:CryptGetProvParam(hProv,<br> &nbsp; &nbsp; &nbsp; PP_ENUMALGS, <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pbData, <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;@cbData,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dwFlags);<br>得到的pbdata赋给一个数组。(pbdata是pbyte类型)。数组名为szName.<br>谢谢!
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
599
import
I
I
回复
0
查看
568
import
I
后退
顶部