Create Form Application For DLL
DLL = Borland c++
Code:
#include "Unit1.h"
#include <vcl.h>
#include <windows.h>
#pragma hdrstop
#pragma argsused
void InitForm()
{
Application->Initialize();
Application->Title = "Mpgh";
Application->CreateForm(__classid(TForm1), &Form1);
Application->Run();
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
if (fwdreason == DLL_PROCESS_ATTACH)
{
CreateThread(NULL,NULL, (LPTHREAD_START_ROUTINE)InitForm, NULL, NULL, NULL);
}
else if (fwdreason == DLL_PROCESS_DETACH)
{
ExitProcess(0);
}
return true;
}
