Here is the delphi code:
library FormDLL;
uses
Unit1 in 'Unit1.pas' {Form1};
exports
getfile;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function getfile (fis: Pchar) : pchar; stdcall;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
opendialog1.Execute;
end;
function getfile (fis: Pchar) : pchar; stdcall
var
Form1 : TForm1;
begin
Form1 := Tform1.Create (application);
form1.OpenDialog1.Execute;
end;
end.
Here is the Blitzbasic code:
While Not KeyHit(1)
If KeyDown ( 32 )=True Then
s$=CallDLL("i:\programs code\darkpro\testdll\FormDll.dll","getfile")
EndIf
Text 10,130,"Return " + s$
Flip
Wend
End
library FormDLL;
uses
Unit1 in 'Unit1.pas' {Form1};
exports
getfile;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function getfile (fis: Pchar) : pchar; stdcall;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
opendialog1.Execute;
end;
function getfile (fis: Pchar) : pchar; stdcall
var
Form1 : TForm1;
begin
Form1 := Tform1.Create (application);
form1.OpenDialog1.Execute;
end;
end.
Here is the Blitzbasic code:
While Not KeyHit(1)
If KeyDown ( 32 )=True Then
s$=CallDLL("i:\programs code\darkpro\testdll\FormDll.dll","getfile")
EndIf
Text 10,130,"Return " + s$
Flip
Wend
End