DELPHIµ÷ÓÃVC±àдµÄDLL º¯Êý²ÎÊýΪLPTSTR
×¢Òâµã£ºLPTSTR ¶ÔÓ¦µÄÊÇPAnsiChar »òÕßPWideChar ÄãÎÊÎÊËûµÄ±àÒëÑ¡Ïî,ÒªÊǶ¨ÒåÁËunicode¾ÍÊÇPWideChar ·ñÔòÊÇPAnsiChar
ÕâÀïÎÒÊÇÓÃUNICODE±à³ÌµÄ£¬ËùÒÔÓõ½µÄÊÇPWideChar
ÔÚVCдµÄA.dllÀïÌí¼ÓÒ»¸öº¯ÊýΪ
extern "C" __declspec(dllexport) LPTSTR WINAPI Do(LPTSTR i)
{
return i;
}
ÔÚDELPHIµ÷ÓÃΪ
type
TDoFunc=function(str:PWideChar) :PWideChar;stdcall;
var
Th:Thandle;
TDo:TDoFunc;
Tp:TFarProc;
str:PWideChar;
strA,strB:PWideChar;
begin
Th:=LoadLibrary('A.dll'); {×°ÔØDLL}
if Th>0 then
try
Tp:=GetProcAddress(Th,PChar('_Do@4'));
if Tp<>nil
then begin
TDo:=TDoFunc(Tp);
strA:='bread';
str:=TDo(strA);
ShowMessage(str);
end
else
ShowMessage('ûÓÐÕÒµ½º¯Êý');
finally
FreeLibrary(Th); {ÊÍ·ÅDLL}
end
else
ShowMessage('dllÎļþûÕÒµ½');
end;
ÕâÑù¾ÍOKÁË£¬(*^__^*) ÎûÎû
ºÃ¿ªÐÄŶ£¬ÓÖ½â¾öÁËÒ»¸öÎÊÌâ
Ïà¹ØÎĵµ£º
function ValidatePID(const APID: string): string;
{ÄÚ²¿º¯Êý,È¡Éí·ÝÖ¤ºÅУÑéλ,×îºóһλ,¶Ô18λÓÐЧ}
function GetVerifyBit(sIdentityNum: string): Char;
var
nNum: Integer;
begin
Result := #0;
nNum := StrToInt(sIdentityNum[1]) * 7 +
  ......
º¯ÊýÒ»£º
view plaincopy to clipboardprint?
uses
Windows,
SysUtils,
Classes,
ShellAPI;
function RunAndWait(FileName: string; Visibility: Integer): THandle;&nbs ......
DelphiÕýÔò±í´ïʽѧϰ£¬²Î¿¼CSDNÍòÒ»ÀÏʦµÄBLOG¡¢CSDN¡¢ÍøÂç×ÊÁÏÒÔ¼°´øÔ´ÂëµÄTPerlRegEx£¬ÔÚ´Ë×¢Ã÷£¬ÒÔºó²»ÔÙ˵Ã÷£¬ÔÚЩ¸ÐлGoogleÀÏʦºÍ°Ù¶ÈÀÏʦ
°²×°£º
ÏÂÔØµØÖ·£ºhttp://download.csdn.net/source/1668436
1¡¢°²×°.dpkÎļþ£¬ÔÚLibaryÖÐÌí¼ÓTPerlRegExµ¥Ôª´æ·Å·¾¶
2¡¢ÔËÐгÌÐòǰ¸´ÖÆpcrelib.dllµ½C:\WINDOWSÏ ......
ÀûÓÃWindows APIº¯ÊýWritePrivateProfileString ºÍGetPrivateProfileString¿É¶Ô.INIÎļþ½øÐжÁд²Ù×÷¡£Æäʵ£¬¶Ô.INIÎļþµÄ¶ÁдÍêÈ«¿ÉÒÔÀûÓÃDelphiµÄÄÚÖú¯ÊýÀ´ÊµÏÖ¡£ÏÂÃæ¾Í½éÉÜһЩ¶Ô.INIÎļþ¶ÁдʱÏà¹ØµÄÀ༰ÆäÊôÐÔ·½·¨¡£
1¡¢TIniFile¶ÔÏó
ÒÔDelphiÖУ¬¶¨ÒåÁËÒ»¸öTIniFile¶ÔÏ󣬽«.INIÎļþ·â×°ÔÚÆäÖУ¬²¢ÌṩһЩ·½·¨£ ......
Delphi µÄ×Ö·û¼°×Ö·û´®[1] - string¡¢AnsiString¡¢WideString¡¢String[n]¡¢ShortString
2008-10-17 14:57:17
//×î³£ÓÃµÄ string
var
str: string; {¶¨Òå}
begin
str := 'ÍòÒ»'; {¸³Öµ}
ShowMessage(IntToStr(Length(str))); {³¤¶ÈÊÇ: 4}
end;
//³¤×Ö·û´® AnsiString; ÔÚµ±Ç°°æ± ......