목록2018/10/10 (2)
C#,Delphi,Oracle,MSSQL 개발자블로그
델파이 DLL 사용하기.
* DLL에서 읽을 함수.(testMessage.dll) function MSG(s:string) : string; export; begin s := '[' + s + ']'; Result := s; end; 1. 핸들러를 이용하여 동적으로 사용하기. uses windows procedure TForm1.Button1Click(Sender: TObject); type TFunc = function(s:string) : string; var Handle : THandle; MyFunc : TFunc; begin Handle := LoadLibrary('testMessage.dll'); if Handle 0 then begin @MyFunc := GetProcAddress(Handle, 'MSG'); if ..
Programming/Delphi
2018. 10. 10. 20:18
델파이 DLL 만들기
1. File -> New -> Other 에서 DLL Wizard를 선택한다. 2. 예제소스 uses SysUtils, Classes, Dialogs; {$R *.res} /// /// 문자열 반환 테스트 /// function MSG(s:string) : string; export; begin s := '[' + s + ']'; Result := s; end; /// /// 메세지박스 테스트 /// procedure MessageBoxBox; export; begin ShowMessage('message test'); end; exports MSG, MessageBoxBox; begin end.
Programming/Delphi
2018. 10. 10. 20:01