Home > Back-end >  The main program function calls a DLL
The main program function calls a DLL

Time:09-26

1. I want to a DLL can invoke a function of the main program, so I made an excuse for

 
The unit uMainAppInterface;

Interface
USES Classes, DB, DBClient;
Type
IMainAppInterface=interface
[' {3 fbfa782-9626-4372-8391 - DA8F4C21397E} ']

The function ExcuteSQL (SQLStr: String; CDS: the TClientDataSet) : integer;
The function CurrentDBType: Integer;
end;
Implementation


End.


2. The main program output
 function ManApp: IMainAppInterface; 
The begin
Result:=TMainAppInterface. Create;

end;
Exports
ManApp;


3. The DLL for

 
TMainAppInterface=function: IMainAppInterface;
Var
MainAppHandle: THandle;

The begin

MainAppHandle:=loadlibrary (' Pproperty. Exe);
@ MainAppInterface:=GetProcAddress call (MainAppHandle, 'ManApp');
end;



4. The interface is implemented, has now become a normal call, but now in the IDE compiler running, sometimes an error external exception EEFFACE
The Event LOG is
The Module Load: profapi. DLL. No Debug Info. The Base Address: $75 ba0000. Process Pproperty. Exe (9564)
Then direct IDE died,

Don't open the IDE without error, it is very strange ~ ~ ~ ~ ~ ~

DELPHI version 2010 system is Windows 7

Turn to 1. If this method is the formal approach,
2. What is at the wrong reason ~ ~ ~

CodePudding user response:

Tangram Plugin FrameWork FrameWork and MyBean FrameWork can do this, download yourself to look at, have related the Demo,

CodePudding user response:

@ wallace_xie you have DEMO can send me a no, thanks

CodePudding user response:

Framework installation, go to http://pan.baidu.com/s/1jGIc2Su to download the Demo of Simple has the features you need, if you have time to study flower Mybean have similar features to download address is http://www.diocp.org/,
  • Related