'Event'에 해당되는 글 6건
- 2014.10.23 Events relate to drive
- 2013.09.23 Implement event sink by ATL
- 2013.09.17 Development Event Log
- 2012.08.01 dynamic create activeX (javascript)
- 2011.08.13 Console Event Handling
- 2009.05.21 call class member function as if global function
Implement dispinterface and dual interface event sink by ATL
http://msdn.microsoft.com/en-us/library/windows/desktop/dd695280(v=vs.85).aspx
- create
- new ActiveXObject 를 이용한다.
- var object = new ActiveXObject(progid);
- link event
- 해당 activeX 가 IProvideClasInfo2 와 IConnnectionPoint 가 구현되어 있어야 한다.
- eval("function object::event1( value ) { event_handler(value); }");
console programming은 event 에 대해서 별로 생각하지 않았지만, 이번 작업은 console server 라서 event notify 관련 함수를 찾아 보았다.
SetConsoleCtrlHandler API 가 관련 함수이고 아래 link 에 관련 post가 있다.
해당 함수를 GDI 없는 순수 console 사용할 때는 아래처럼 정의하면 <window.h>를 정의하지 않아도 된다.
#define NOGDI
#include <WTypes.h>
#include <WinCon.h>
http://www.codeproject.com/KB/winsdk/console_event_handling.aspx
SetConsoleCtrlHandler API 가 관련 함수이고 아래 link 에 관련 post가 있다.
해당 함수를 GDI 없는 순수 console 사용할 때는 아래처럼 정의하면 <window.h>를 정의하지 않아도 된다.
#define NOGDI
#include <WTypes.h>
#include <WinCon.h>
http://www.codeproject.com/KB/winsdk/console_event_handling.aspx
2009. 5. 21. 20:45
call class member function as if global function
2009. 5. 21. 20:45 in text/window general

바람직한 방법인 것 같지는 않지만 MFC로 만들어지 ActiveX에서 event를 전역함수 처럼 호출하여 쓰는 방법이 있다. 비단 event 뿐 아니라 COleControl를 상속받은 class의 모든 member 함수를 호출할 수 있다.
void AfxFireFunc( CWnd * sender,
ONE one,
TWO two )
{
class CHelperCtrl : public CxxxCtrl
{
public:
CHelperCtrl() {}
void FireCallFunc( ONE one, TWO two )
{
CxxxCtrl::FireFunc( one, two );
}
};
CHelperCtrl * ctrl;
ctrl = (CHelperCtrl * )s_Controls.Query( sender );
if (ctrl)
ctrl->FireFunc( one, two );
}
//
static COleInstances s_Controls;
s_Controls.Query 는 COleControl의 pointer를 가지고 있으며, sender로 자식 창의 pointer를 넣어주면 부모인 COleControl의 pointer를 넘겨준다.
void AfxFireFunc( CWnd * sender,
ONE one,
TWO two )
{
class CHelperCtrl : public CxxxCtrl
{
public:
CHelperCtrl() {}
void FireCallFunc( ONE one, TWO two )
{
CxxxCtrl::FireFunc( one, two );
}
};
CHelperCtrl * ctrl;
ctrl = (CHelperCtrl * )s_Controls.Query( sender );
if (ctrl)
ctrl->FireFunc( one, two );
}
//
static COleInstances s_Controls;
s_Controls.Query 는 COleControl의 pointer를 가지고 있으며, sender로 자식 창의 pointer를 넣어주면 부모인 COleControl의 pointer를 넘겨준다.