exe도 Dll로 쓸 수 있어요.

702 단어
function abcd(x: integer): integer; stdcall;    
var    
  Form1: TForm1;    
implementation    
    
function abcd(x: integer): Integer; stdcall;    
begin    
  Result := x * 2;    
end;    
{$R *.dfm}    
exports    
  abcd;    
    
var    
  abcd:function(x:integer):Integer;stdcall;    
  H: THandle;    
begin    
  h := LoadLibrary('exeDllTest.exe');    
  if H > 32 then    
  begin    
    @abcd := GetProcAddress(h, 'abcd');    
    ShowMessage(inttostr(abcd(8)));    
  end;    
  FreeLibrary(h);    
end;    

좋은 웹페이지 즐겨찾기