//--------------------------------------------------------------------------- #include #include #define __PLUGIN_DLL_EXPORT__ #include "VMS0400MF.h" USEFORM("VMS0400MF.cpp", VMS0400M); // Ãß°¡µÈ ÆûÀÇ cppÆÄÀÏ ³»¿ëÀÇ // extern PACKAGE TdllFrm *dllFrm; // À̺κп¡¼­ dllFrmÂüÁ¶ Æû¸íÀ» ÀûÀ¸¸é // // TdllFrm* dllFrm => ó·³ ÇÏÁö ¾Ê¾Æµµ µË´Ï´Ù. // // ÀÛ¼ºµÈ dllFrm Æ÷ÀÎÅ͸¦ ¹Ù·Î »ç¿ëÇÒ¼ö ÀÖ½À´Ï´Ù. #pragma hdrstop //--------------------------------------------------------------------------- // Important note about DLL memory management when your DLL uses the // static version of the RunTime Library: // // If your DLL exports any functions that pass String objects (or structs/ // classes containing nested Strings) as parameter or function results, // you will need to add the library MEMMGR.LIB to both the DLL project and // any other projects that use the DLL. You will also need to use MEMMGR.LIB // if any other projects which use the DLL will be performing new or delete // operations on any non-TObject-derived classes which are exported from the // DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling // EXE's to use the BORLNDMM.DLL as their memory manager. In these cases, // the file BORLNDMM.DLL should be deployed along with your DLL. // // To avoid using BORLNDMM.DLL, pass string information using "char *" or // ShortString parameters. // // If your DLL uses the dynamic version of the RTL, you do not need to // explicitly add MEMMGR.LIB as this will be done implicitly for you //--------------------------------------------------------------------------- #pragma argsused PLUGIN_LIB TPlugInForm * __stdcall ShowPlugInForm(ST_PlugInData *pPlugIn, TComponent *Owner/*=NULL*/, TComponent *Parent/*=NULL*/, TFormStyle nFormStyle/*=fsMDIChild*/, bool bShowModal/*=false*/) { TVMS0400M *VMS0400M = NULL; try { VMS0400M = new TVMS0400M(Owner); if (Parent) VMS0400M->Parent = (TWinControl*)Parent; VMS0400M->m_PlugIn.lpData1 = pPlugIn->lpData1; VMS0400M->m_PlugIn.lpData2 = pPlugIn->lpData2; VMS0400M->m_PlugIn.lpData3 = pPlugIn->lpData3; VMS0400M->m_PlugIn.lpData4 = pPlugIn->lpData4; VMS0400M->m_PlugIn.lpData5 = pPlugIn->lpData5; if (bShowModal) { VMS0400M->ShowModal(); //delete VMS0400M; VMS0400M = NULL; } else { VMS0400M->Show(); } } catch(...) { if (VMS0400M) { delete VMS0400M; VMS0400M = NULL; } } return (TPlugInForm *)VMS0400M; } PLUGIN_LIB TPlugInForm * __stdcall GetPlugInForm (ST_PlugInData *pPlugIn, TComponent *Owner/*=NULL*/, TComponent *Parent/*=NULL*/, TFormStyle nFormStyle/*=fsMDIChild*/) { TVMS0400M *VMS0400M = NULL; try { VMS0400M = new TVMS0400M(Owner); VMS0400M->m_PlugIn.lpData1 = pPlugIn->lpData1; VMS0400M->m_PlugIn.lpData2 = pPlugIn->lpData2; VMS0400M->m_PlugIn.lpData3 = pPlugIn->lpData3; VMS0400M->m_PlugIn.lpData4 = pPlugIn->lpData4; VMS0400M->m_PlugIn.lpData5 = pPlugIn->lpData5; if (Parent) VMS0400M->Parent = (TWinControl*)Parent; VMS0400M->FormStyle = nFormStyle; } catch(...) { if (VMS0400M) { delete VMS0400M; VMS0400M = NULL; } } return (TPlugInForm *)VMS0400M; } int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved) { #ifdef FREELIBMSG if (reason == DLL_PROCESS_DETACH) { try { if (!ITSDb_IsApplicationTerm()) { ST_WMMESSAGE *pWmMsg = new ST_WMMESSAGE; pWmMsg->hWnd = (HWND)NULL; pWmMsg->pForm = (void*)NULL; pWmMsg->sSender = "VMS0400M"; pWmMsg->sReceiver = ""; pWmMsg->sMsg = ""; pWmMsg->nMsg = DLL_PROCESSDETACH; PostMessage(Application->MainForm->Handle, WM_PLUGINFORM, (WPARAM)pWmMsg, 0); } } catch(...) {} } #endif return 1; } //---------------------------------------------------------------------------