|
일단 dll project를 하나 만드신 다음
만드신 form을 include하시고
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
if(BuilderForm == NULL)
{
Application->Initialize();
Application->CreateForm(__classid(TBuilderForm),&BuilderForm);
}
return 1;
}
//---------------------------------------------------------------------------
extern "C" void __declspec(dllexport) TestBuilderFormView()
{
BuilderForm->ShowModal();
}
부르는 쪽에서 static or dynamic으로 call하시면 되지 않을까요?
ex) dynamic call
hMod = ::LoadLibrary("BuilderFormView.dll");
typedef void (*PFNTestBuilderFormView)();
PFNTestBuilderFormView BuilderFormView = (PFNTestBuilderFormView)::GetProcAddress(hMod,"_TestBuilderFormView");
BuilderFormView();
|