This commit is contained in:
2013-09-05 05:06:37 +00:00
parent a5fc2f3da6
commit 1c2c65a348
7 changed files with 92 additions and 20 deletions

View File

@@ -28,6 +28,7 @@ LONG CVCOptModule::Lock()
AfxOleLockApp();
return 1;
}
LPCTSTR CVCOptModule::FindOneOf(LPCTSTR p1, LPCTSTR p2)
{
while (*p1 != NULL)
@@ -144,7 +145,7 @@ BOOL CCPRobotApp::InitInstance()
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCtrls.dwICC = ICC_COOL_CLASSES;
InitCtrls.dwICC = ICC_STANDARD_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinAppEx::InitInstance();
@@ -179,3 +180,16 @@ BOOL CCPRobotApp::InitInstance()
// 반환합니다.
return FALSE;
}
int CCPRobotApp::ExitInstance()
{
// TODO: Add your specialized code here and/or call the base class
if (m_bATLInited)
{
_Module.RevokeClassObjects();
_Module.Term();
CoUninitialize();
}
return CWinAppEx::ExitInstance();
}

View File

@@ -33,13 +33,14 @@ public:
// 재정의입니다.
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
// 구현입니다.
DECLARE_MESSAGE_MAP()
private:
BOOL m_bATLInited;
BOOL InitATL();
};

Binary file not shown.

View File

@@ -1,10 +1,8 @@
// CPRobotDlg.h : 헤더 파일
//
#pragma once
#include "afxwin.h"
#include "EventHandler.h"
#include "Trader.h"
#include <string>
#include <vector>
#include <hash_map>
@@ -146,6 +144,6 @@ private:
inline void SwitchState(const CP_STATE enState);
void CPLog(const std::string fmt, ...);
void CPLog(const string fmt, ...);
};

View File

@@ -27,4 +27,4 @@ void __stdcall CEventHandlerDib::Received()
ASSERT(NULL != m_pIEventHandler);
m_pIEventHandler->ReceivedDib();
}
}

View File

@@ -6,24 +6,18 @@
#include <atlbase.h>
#include <atlcom.h>
class IEventHandlerSysDib
{
public:
virtual void ReceivedSysDib() = 0;
};
class IEventHandlerDib
{
public:
virtual void ReceivedDib() = 0;
};
class CEventHandlerSysDib : public IDispEventImpl<
0,
CEventHandlerSysDib,
&CpSysDib::DIID__ISysDibEvents,
&CpSysDib::IID_ISysDib,
&CpSysDib::LIBID_CpSysDib,
1,
0>
{
@@ -33,18 +27,27 @@ public:
void __stdcall Received();
BEGIN_SINK_MAP(CEventHandlerSysDib)
SINK_ENTRY_EX(0, CpSysDib::DIID__ISysDibEvents, 0x01, Received)
SINK_ENTRY_EX(0, CpSysDib::DIID__ISysDibEvents, 1, Received)
END_SINK_MAP()
protected:
IEventHandlerSysDib* m_pIEventHandler;
};
extern "C" const GUID __declspec(selectany) LIBID_CpDib = GUID(__uuidof(CpDib::__DSCBO1Lib));
extern "C" const GUID __declspec(selectany) DIID__IDibEvents = GUID(__uuidof(CpDib::_IDibEvents));
class IEventHandlerDib
{
public:
virtual void ReceivedDib() = 0;
};
class CEventHandlerDib : public IDispEventImpl<
0,
CEventHandlerDib,
&__uuidof(CpDib::_IDibEvents),
&__uuidof(CpDib::IDib),
&DIID__IDibEvents,
&LIBID_CpDib,
1,
0>
{
@@ -54,11 +57,68 @@ public:
void __stdcall Received();
BEGIN_SINK_MAP(CEventHandlerDib)
SINK_ENTRY_EX(0, __uuidof(CpDib::_IDibEvents), 0x01, Received)
SINK_ENTRY_EX(0, DIID__IDibEvents, 1, Received)
END_SINK_MAP()
protected:
IEventHandlerDib* m_pIEventHandler;
};
//class IEventHandlerSysDib
//{
//public:
// virtual void Received() = 0;
//};
//
//class CEventHandlerSysDib : public IDispEventImpl<
// 0,
// CEventHandlerSysDib,
// &CpSysDib::DIID__ISysDibEvents,
// &CpSysDib::LIBID_CpSysDib,
// 1,
// 0>
//{
//public:
// void SetIEventHandler(IEventHandlerSysDib* pIEventHandler);
//
// void __stdcall Received();
//
// BEGIN_SINK_MAP(CEventHandlerSysDib)
// SINK_ENTRY_EX(0, CpSysDib::DIID__ISysDibEvents, 0x01, Received)
// END_SINK_MAP()
//
//protected:
// IEventHandlerSysDib* m_pIEventHandler;
//};
//class IEventHandlerDib
//{
//public:
// virtual void ReceivedDib() = 0;
//};
//
//class CEventHandlerDib : public IDispEventImpl<
// 0,
// CEventHandlerDib,
// &__uuidof(CpDib::_IDibEvents),
// &__uuidof(CpDib::IDib),
// 1,
// 0>
//{
//public:
// void SetIEventHandler(IEventHandlerDib* pIEventHandler);
//
// void __stdcall ReceivedDib();
//
// BEGIN_SINK_MAP(CEventHandlerDib)
// SINK_ENTRY_EX(0, __uuidof(CpDib::_IDibEvents), 0x02, ReceivedDib)
// END_SINK_MAP()
//
//protected:
// IEventHandlerDib* m_pIEventHandler;
//};
#endif /* __EVNET_HANDLER_H__ */

View File

@@ -37,7 +37,6 @@
#include <afxcontrolbars.h> // MFC support for ribbons and control bars
//#include <comdef.h>
#import "c:\daishin\cybosplus\cpdib.dll" rename_namespace("CpDib")
#import "c:\daishin\cybosplus\cpsysdib.dll" rename_namespace("CpSysDib") named_guids
#import "c:\daishin\cybosplus\cptrade.dll" no_namespace named_guids