COM 46

Dispinterface vs. Events and Runtime Sinks - 싱크에서 디스핀터페이스 사용 코딩 구현 참조

Dispinterface vs. Events and Runtime Sinks Rating: none Andrew Whitechapel (view profile) April 12, 2001 In the normal COM scheme of things, the communication between client and server is driven by the client. The client creates the server's COM object, and makes calls into the object as it needs to. The object generally sits there passively waiting for calls from clients. However, sometimes, th..

COM, ATL 2008.08.28

논리상 생성자에서 처리해도 되는 것을 Init 함수를 따로 빼서 사용하는 이유

생성자는 리턴값을 따로 두지 않는다. 에러를 조사하고자 하는 경우는 리턴값으로 확인할 수 없다. 그래서 초기화 함수를 따로 빼서 코딩해야하는 경우가 있다. 컴포넌트 관련 코딩에서 많이 발견된다. 물론 객체 생성후 항상 Init함수를 호출해준다. 다음은 그 예이다. // 생성자 COEnumConnections::COEnumConnections( IUnknown* pHostObj) { // Zero the COM object's reference count. m_cRefs = 0; // Assign the Host Object pointer. m_pHostObj = pHostObj; // Initialize the Connection Point enumerator variables. m_iEnumIndex ..

C, C++ 문법 2008.08.27

lcid 로케일

스트링은 유니코드를 사용하라. COM은 내부적으로도 대외적으로도 유니코드를 사용한다. 유니코드는 MBCS(Multi-Byte Code System)와 달리 아시아계 문자 뿐 아니라, 영어권 문자도 2바이트를 사용한다. 이로 인해 아시아계 문자와 영어권 문자의 표현 크기가 틀려서 생기는 코딩의 어려움을 해결할 수 있다. 유니코드는 프로그래머의 편의보다도, 전세계 문자를 하나의 코드체계에 포함시킨 것에 더 큰 의미를 가지고 있다. COM 인터페이스는 잘 정의된다면 전세계적으로 통용되는 것이다. 따라서 스트링의 표현을 유니코드로 하는 것은 자연스러운 일이다. Visual C++에서 유니코드 문자 데이타는 WCHAR 혹은 OLECHAR 타입으로 정의되어 있다. 또한 리터럴(literal)을 유니코드로 지정할 경..

COM, ATL 2008.08.18

ActiveX로 웹페이지의 URL가져오기

-응용 예) ActiveX 콘트롤로 특정 도메인 접속이나 특정 파일 경로의 접근을 막을수 있다 ActiveX초기화 상태에서 인터넷 익스플로어는 IOleObject::SetClientSite()로 포인터를 사이트에 넘기는데 이때 URL을 가져올수 있다 1. Obtain the client site (IOleClientSite) interface pointer. The container calls IOleObject::SetClientSite() to pass a pointer to the client site. Override this method to cache this pointer. 2. Obtain a moniker to the client site by calling IOleClientSite::..

웹, HTML 2008.08.14