1.我想DLL 可以呼叫主程式的函式,所以我做了一個借口
unit uMainAppInterface;
interface
uses Classes,DB,DBClient;
type
IMainAppInterface = interface
['{3FBFA782-9626-4372-8391-DA8F4C21397E}']
function ExcuteSQL(SQLStr: String; CDS: TClientDataSet): integer;
function CurrentDBType:Integer;
end;
implementation
end.
2. 主程式輸出
function ManApp: IMainAppInterface;
begin
result := TMainAppInterface.Create;
end;
exports
ManApp;
3.DLL 獲取
TMainAppInterface = function: IMainAppInterface;
var
MainAppHandle: THandle;
begin
MainAppHandle := loadlibrary('Pproperty.exe');
@MainAppInterface := GetProcAddress(MainAppHandle, 'ManApp');
end;
4.介面已經實作,現在已經可以正常呼叫了,但是現在在IDE編譯運行的時候,有時會報錯 external exception EEFFACE
Event LOG 提示是
Module Load: profapi.dll. No Debug Info. Base Address: $75BA0000. Process Pproperty.exe (9564)
然后IDE直接死了。
不在IDE中打開又不會報錯。很奇怪~~~~~~
DELPHI 版本 2010 系統是 WIN7
求助1.這鐘方法是否是正規的做法,
2.報這個錯是什么原因~~~
uj5u.com熱心網友回復:
Tangram Plugin FrameWork框架和MyBean框架就可以這樣操作的,自己下載看一下。有相關的Demo。uj5u.com熱心網友回復:
@wallace_xie 你有DEMO 嘛 可以發一個給我不 謝謝uj5u.com熱心網友回復:
去http://pan.baidu.com/s/1jGIc2Su下載框架安裝,Demo中的Simple就有你需要的功能。如果有時間研究的花Mybean也有類似功能下載地址是http://www.diocp.org/。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/82121.html
標籤:語言基礎/算法/系統設計
