原创 the CComSingleThreadModel & the CComMultiThreadModel

 CComSingleThreadModel class CComSingleThreadModel { public:  static ULONG WINAPI Increment(LPLONG p) throw() {return +

原创 the CComObjectRootEx

  template <class ThreadModel> class CComObjectRootEx : public CComObjectRootBase { public:  typedef T

原创 something about com

 IDispatch   1、服務器類型的區別:    動態連接庫  可執行文件  服務 2、附件選項的作用:    允許合併代理/存根代碼 ??  支持MFC  ??不支持會怎麼樣    支持COM+ 1.0 T   支持部件 註冊器

原创 COM的線程管理

單線程單元:使COM對象可以存在與同一進程中的不同線程中。 在STA前,所有組件的訪問都通過應用程序的主線成進行下去。假設利用進程外服務器通過某一組件的100個實例來管理100個客戶,那麼,客戶程序對於一個實例的訪問講被串行化這是因爲它必

原创 標準Com接口

IUnknow 1、爲一個組件用戶提供一種標準途徑,通過該途徑,用戶可以在指定的組件裏要求使用一個特定的接口。QueryInterface可以完成該功能。 2、幫組組件在生存期內進行管理。IUnknown提供兩種方法:AffRef和Rel

原创 對Com接口的使用

Com API CoCreateInstance函數。是客戶應用程序在創建組件實例時使用的。   //create an instance and return the IMath interface IMath * pMath; HRE

原创 the IObjectWithSiteImpl

  This class provides methods allowing an object to communicate with its site. 實現一個對象與其對應的頁面進行交互的方法  

原创 the IDispatch

  IDispatch   is   one   of   the   ubiquitously   implemented   interfaces   of   ActiveX   controls.

原创 the CComCoClass

 CComCoClass   CComCoClass provides methods for retrieving an object's CLSID, setting error information, and creating i

原创 the IObjectSafetyImpl

  IObjectSafetyImpl   Allows an object to be marked as safe for initialization or safe for scripting.

原创 自動化 雙向接口

自動化基於COM的IDispatch接口的。IDispatch接口提供了一系列的方法,使得客戶機程序能夠在基於自動化的服務器上到你櫃檯訪問組件的功能。這種調用與COM的自定義接口技術是不同的。   自動化數據類型   BSTR :一個二進

原创 Com模型的原始實現-com精髓:接口

從C++的虛函數表說起 Vtable是C++中提供類實例功能滯後綁定的實現。運行時調用的函數,而不必在編譯時就靜態地確認連接。   class Fruit{ public: void put_color(string str) { m

原创 what is com

  COM is the fundamental "object model" on which ActiveX Controls and OLE are built. COM allows an obj

原创 ATL and CON

Com功能項                                                                                                               AT

原创 the ISupportErrorInfo

  This interface ensures that error information can be propagated up the call chain correctly. Automat