Thanx, it's look good. Is it possible to register class from DLL to main application classes list? I try to explain what I need.
Usually, DB application, have a lot of editing/inserting records forms. My idea is very simply. Every table have predefined form for editing/inserting. I have a list of matches between table name and form classname (it stored in database). Due to this, there is an opportunity to open the forms of editing/inserting from any place of the application without including into "uses ..." clause.
Last two years it work Ok, but now, I'm trying to put some forms into DLL's. Is it possible to do this avoiding of modification any of my service units?
Regards,
Igor
0
Be seen. Boost your question’s priority for more expert views and faster solutions
That should do all the work! Now in your application you only need to call LoadLibrary('yourDll.dll') and then the dll puts it's class automatically into the class list of the application.
Tricky, isn't it!? :-)
Regards, Madshi.
P.S: But remember: The DLLs and the application MUST be compiled with the same Delphi version, otherwise the TPersistentClass classes might not be compatible -> wild exceptions!
An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
If your DLL and your application is written in exactly the same Delphi version, you can export a function from your dll like this:
function GetClass : TPersistentClass;
begin
result := TMyClass;
end;
exports GetClass;
Then in your application do this:
var GetDllClass : function GetClass : TPersistentClass = nil;
var dll : dword;
begin
dll := LoadLibrary('your.dll');
GetDllClass := GetProcAddress(dll, 'GetClass');
// Now you can call GetDllClass
Regards, Madshi.