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.0144 sec