Introduction - If you have any usage issues, please Google them yourself
Hey hey, the big man see don't laugh...
Everyone knows the benefits of using DLLS, so I want to wrap the FORM inside the DLL.
On the Internet, it is found that MDI and mode forms have many problems. I want to solve this problem myself.
It was used to create an object back with a DLL, but found a lot of problems.
If you think about it for a long time, you can ask for roots.
I found the class.
I want to encapsulate the class into a DLL, and then simply return a class, and it's easy to do in the main program, okay?
I found TFormClass for a long time, so I tried to export from the DLL, and I found success by creating the form like a normal program.
And then I want to see if other classes can do this, and I'm going to experiment with TFrame.
The function GetDllFrameClass () : TFrame stdcall
The first time it was declared, it failed. Strange? !
I tried it many times, and I thought of TFormClass(Ctrl+ left), go in and see what it says.
TFormClass = class of TForm
Oh, what a sudden enlightenment!!
Class (TFrame) is the declaration of a class, which inherits the TFrame class f: TFrame is an object
Class of TFrame declares the class type, f:TFrameClass is a class.
The function GetDllFrameClass () : TFrame
The return is not the class but the object, TFrameClass = class of TFrame, after TFormClass
Run... Success,
Packet : 111186749notblack_dllclass.rar filelist
Dll\Dll.dof
Dll\Dll.dpr
Dll\Dll.res
Dll\Unit1.dfm
Dll\Unit1.pas
Dll\Unit2.dfm
Dll\Unit2.pas
Dll
Main\Main.dof
Main\Main.dpr
Main\Main.res
Main\Unit1.dfm
Main\Unit1.pas
Main
Bin\Dll.dll
Bin\Main.exe
Bin
ReadMe.txt
notblack_DllClass.gif
2ccc.com.nfo
Dll\2ccc.com.nfo