E D R , A S I H C RSS

Active Template Library

ATL?

{{|The Active Template Library (ATL) is a set of template-based C++ classes that simplify the programming of Component Object Model (COM) objects. The COM support in Visual C++ allows developers to easily create a variety of COM objects, Automation servers, and ActiveX controls.
|}}
ATL은 템플릿으로 이루어진 C++ 클래스 집합니다. 이 클래스들은 COM 객체를 프로그래밍하는 과정을 단순화시킨다. VisualC++에서 COM의 지원은 개발자들이 쉽게 다양한 COM객체, Automation 서버, ActiveX 컨트롤들을 생성하도록 해준다.

Tips

String Conversion

OLE String 과 PSTR 등의 일반 스트링형 간 형변환 할 일이 있을때.

ex) OLE2CA : OLE string 2(to) Const Ansi sting

ATL string의 형변환시에는 ~cpp USES_CONVERSION macro를 형변환 전에 호출하여야함.

CComQIPtr

~cpp QueryInterface 까지 대신 해주는 smart pointer class

~cpp 
//CComQIPtr 사용예
CComQIPtr<IOleWindow> pOleWin(pUnk);

//일반적인 COM interface 사용은
IOleWinodow* pOleWin;
pUnk->QueryInterface(IOleWindow, IID_IOleWindow, &pOleWin);
//... 
pOleWin->Release();
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:22:26
Processing time 0.0704 sec