Delphi DLL调用中数据类型问题
主要代码如下:FunctionSHRunFileDlg(hOwner,hIcon:Integer;lpstrDirectory,szTitle,szPrompt:pcha...
主要代码如下:
Function SHRunFileDlg(hOwner,hIcon:Integer;lpstrDirectory,szTitle,szPrompt:pchar;uFlags:Integer):Integer;external'shell32.dll'index 61;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
SHRunFileDlg (0,form1.Icon.Handle,'c:\windows',PCHAR(3333),PCHAR(5151),NIL);
//Private Declare Function SHRunFileDlg Lib "Shell32" Alias "#61" (ByVal hOwner As Long, ByVal hIcon As Long, ByVal lpstrDirectory As String, ByVal szTitle As String, ByVal szPrompt As String, ByVal uFlags As Long) As Long
//SHRunFileDlg Form1.hWnd, Form1.Icon.Handle, "c:\windows", "运行程序演示", "在文本框中输入程序名或按浏览键查找程序", 0
end;
end.
双//后面是VB中的声明与调用,没有任何问题,我以前是用VB的,
错误提示如下:
[Warning] Unit1.pas(21): Symbol 'INDEX' is specific to a platform
[Error] Unit1.pas(31): Incompatible types: 'Integer' and 'Pointer'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
谢谢指点一下,
我把最后面一个参数的实参设为0,结果顺利编译,但运行后会出错,但第一个警告还是存在,就是关于index 61的问题 展开
Function SHRunFileDlg(hOwner,hIcon:Integer;lpstrDirectory,szTitle,szPrompt:pchar;uFlags:Integer):Integer;external'shell32.dll'index 61;
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
SHRunFileDlg (0,form1.Icon.Handle,'c:\windows',PCHAR(3333),PCHAR(5151),NIL);
//Private Declare Function SHRunFileDlg Lib "Shell32" Alias "#61" (ByVal hOwner As Long, ByVal hIcon As Long, ByVal lpstrDirectory As String, ByVal szTitle As String, ByVal szPrompt As String, ByVal uFlags As Long) As Long
//SHRunFileDlg Form1.hWnd, Form1.Icon.Handle, "c:\windows", "运行程序演示", "在文本框中输入程序名或按浏览键查找程序", 0
end;
end.
双//后面是VB中的声明与调用,没有任何问题,我以前是用VB的,
错误提示如下:
[Warning] Unit1.pas(21): Symbol 'INDEX' is specific to a platform
[Error] Unit1.pas(31): Incompatible types: 'Integer' and 'Pointer'
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
谢谢指点一下,
我把最后面一个参数的实参设为0,结果顺利编译,但运行后会出错,但第一个警告还是存在,就是关于index 61的问题 展开
展开全部
兄弟,又碰上你了。你是想调用DLL呢,还是想用这个DLL打开运行啊?如果是想打开运行的话,在你
http://zhidao.baidu.com/question/41073099.html
这个问题里我已经给你源代码了。
http://zhidao.baidu.com/question/41073099.html
这个问题里我已经给你源代码了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询