易截截图软件、单文件、免安装、纯绿色、仅160KB

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 Delphi 内存速度比较 - VC/MFC / 非技术类

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 ......

DELPHI DLL实参传窗体

//DLL 放在EXE中没问题
function SkinForm(var skfrm:TForm):Integer;stdcall;
var
  skf:TbsBusinessSkinForm;
  nskfrm:TForm;
begin
  frmUUMain:=skfrm;
  skf:=TbsBus ......

Delphi Thread

主窗体:
Delphi(Pascal) code:

procedure TfrmMain.btnResumeClick(Sender: TObject);
begin
myThread := TClientThread.Create(LeftPart(cbbServer.Text, ':'), StrToInt(RightPart(cbbServer.Text, ':')) ......

问几个delphi的属性问题

edit.begindrag(false,10);表面看应该是开始拖动里面的false,10参数本别对应什么? 
procedure TDragForm.ListDragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: B ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号