F
Free
Unregistered / Unconfirmed
GUEST, unregistred user!
在VB中declare sub loadmcp lib"mcp.dll"()在DELPHI中应如何写?
在VB中declare sub unloadmcp lib"mcp.dll"()在DELPHI中应如何写?
我用的是DELPHI1。0 在VB中一DLL的声明如下:declate function opendrw lib"posdev.dll"() 我把它改在DELPHI下:
unit Unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
myhandle,onehandle,twohandle:thandle;
opendraw: function:integer;
x:integer;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
onehandle:=loadlibrary('mcp.dll');
twohandle:=loadlibrary('init.dll');
myhandle:=loadlibrary('posdev.dll');
IF MYHAndle<=0
then edit1.text:='false'
else edit1.text:='true';
@opendraw:=getprocaddress(myhandle,'posdev');
if not assigned(opendraw)
then edit2.text:='false'
else edit2.text:='true';
x:=opendraw();
end;
end.
但是在x:=opendraw()一句报错ERR0R85:";"EXPECTED
我应该如何调用该函数?
在VB中declare sub unloadmcp lib"mcp.dll"()在DELPHI中应如何写?
我用的是DELPHI1。0 在VB中一DLL的声明如下:declate function opendrw lib"posdev.dll"() 我把它改在DELPHI下:
unit Unit1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
myhandle,onehandle,twohandle:thandle;
opendraw: function:integer;
x:integer;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
onehandle:=loadlibrary('mcp.dll');
twohandle:=loadlibrary('init.dll');
myhandle:=loadlibrary('posdev.dll');
IF MYHAndle<=0
then edit1.text:='false'
else edit1.text:='true';
@opendraw:=getprocaddress(myhandle,'posdev');
if not assigned(opendraw)
then edit2.text:='false'
else edit2.text:='true';
x:=opendraw();
end;
end.
但是在x:=opendraw()一句报错ERR0R85:";"EXPECTED
我应该如何调用该函数?