123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include <windows.h>
- #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;
- }
- //---------------------------------------------------------------------------
|