문제 설명
파스칼스크립트에 DLL 함수 등록하기 (Registering DLL‑Functions in Pascalscript)
응용 프로그램을 다시 컴파일하지 않고 스크립트 기능을 확장하는 일종의 플러그인 시스템에 대해 생각하고 있습니다.
제 생각은 시작하는 동안 프로그램이 검사하는 것입니다. 폴더를 만들고 발견된 모든 DLL을 등록합니다. (각 DLL은 하나의 함수를 노출합니다). 함수가 정의된 DLL이 무엇인지 모르기 때문에 함수 FindWindow(c1, c2: PChar): 카디널; 외부 'FindWindow@user32.dll stdcall'; PascalScript 예제 중 하나에 있습니다.
누군가 이것을 달성하는 방법에 대한 아이디어가 있습니까?
안녕하세요 ‑ 클라우스
참조 솔루션
방법 1:
The typical approach with plugin DLLs is that each DLL exports the same function name. Then the host program knows what function to call when it's loaded.
In your case, for example, your application could pass that function a reference to the Pascal Script interpreter, and then the DLL could use it to register whatever script functions the DLL provides.
(by Klaus.Meier、Rob Kennedy)