VC静态调用DELPHI DLL
Delphi(Pascal) code:
library Smart;
uses
SysUtils,
Classes,
Forms,
Dialogs,
Windows,
SmartWord in 'SmartWord.pas' {frmSmartWord},
pub in 'pub.pas';
{$R *.res}
var
AppDLL:TApplication;
ScrDLL:TScreen;
//
procedure MyDLLProc(Reason:Integer);
begin
try
if Reason=DLL_PROCESS_DETACH then
begin
Application:=AppDLL;
Screen:=ScrDLL;
end;
except
on e:Exception do
begin
ShowMessage(e.Message);
end;
end;
end;
//function SmartWord(App:TApplication;Scr:TScreen;DoctorName,UserName:PChar):Boolean;stdcall;
function SmartWord(DoctorName,UserName:PChar):Boolean;stdcall;
begin
//Application:=App;
//ScrDLL:=Screen;
//showmessage(doctorname);
//showmessage(username);
sDoctorName:=DoctorName;
sUserName:=UserName;
if not Assigned(frmSmartWord) then
Application.CreateForm(TfrmSmartWord,frmSmartWord);
frmSmartWord.Show;
end;
exports
SmartWord;
begin
try
AppDLL:=Application;
ScrDLL:=Screen;
DLLProc:=@MyDLLProc;
except
on e:Exception do
ShowMessage(e.Message);
end;
end.
用delphi来静态调用没有问题
Delphi(Pascal) code:
function SmartWord(DoctorName,UserName:PChar):Boolean;stdcall;ex
相关问答:
VC 控制台程序:
#include <iostream>
using namespace std;
int main()
{
const int def_buffer = 1024 * 4;
DWORD t;
BYTE b[def_buffer];
memset(b, 0, sizeof(b));
PBYTE p;
t = GetTickC ......
//DLL 放在EXE中没问题
function SkinForm(var skfrm:TForm):Integer;stdcall;
var
skf:TbsBusinessSkinForm;
nskfrm:TForm;
begin
frmUUMain:=skfrm;
skf:=TbsBus ......
主窗体:
Delphi(Pascal) code:
procedure TfrmMain.btnResumeClick(Sender: TObject);
begin
myThread := TClientThread.Create(LeftPart(cbbServer.Text, ':'), StrToInt(RightPart(cbbServer.Text, ':')) ......
edit.begindrag(false,10);表面看应该是开始拖动里面的false,10参数本别对应什么?
procedure TDragForm.ListDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: B ......