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
Ïà¹ØÎÊ´ð£º
ÒÑÖªPython ÖУº
s = unicode("²âÊÔ", "gb2312")
s = u'\u6d4b\u8bd5'
print s
²âÊÔ
ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô³ÉGb2312µÄºº×ÖÄØ£¿
ÕÒµ½¸ö·½·¨
......
Çë½Ì¸÷·¸ßÊÖ¡£ÎäÁÖÇ°±²¡£ÎÒ½«B.EXE×ö³É×ÊÔ´Îļþ£¬È»ºó¼Óµ½123.dllÖС£ÓÃA.EXEÀ´µ÷ÓÃ123.dllÖеÄB.EXE
Çë¸÷λǰ±²°ïæָ½ÌÏ¡£A.exeÈçºÎÀ´µ÷ÓÃdllÖеÄexe£¿´úÂëÓÖ¸ÃÈçºÎд£¿
ÎÞÈ˻شð£¿
×ö³É×ÊÔ´Î ......
xml := CreateOleObject('Microsoft.XMLHTTP');
xml.Open('GET','http://www.google.com', False);
xml.Send;
xml.responseText;
ʹÓÃxml.responseText¿ÉÒÔ»ñÈ¡ÍøÒ³Ô´Âë,µ«ÊÇÔÙ´Î ......
Delphi(Pascal) code:
library HealthDocDll;
uses
SysUtils,
Classes,
Forms,
Dialogs,
Windows,
HealthDoc in 'HealthDoc.pas' {frmHealthDoc},
pub in 'pub.pas';
{$R *.res}
proced ......