代码改变世界

随笔分类 -  J.COM技术

COM中集合和枚举器笔记(2)枚举器内部实现

2012-11-08 13:20 by Clingingboy, 524 阅读, 收藏, 编辑
摘要: 一.ATL枚举器接口 CComIEnum通用枚举器接口 template<class T>class ATL_NO_VTABLE CComIEnum : public IUnknown{public: STDMETHOD(Next)( _In_ ULONG celt, _Out_ T* rgelt, _Out_opt_ ULON... 阅读全文

COM中集合和枚举器笔记(1)概念

2012-11-08 11:06 by Clingingboy, 655 阅读, 收藏, 编辑
摘要: 参考: http://www.cnblogs.com/clingingboy/archive/2011/06/15/2081786.html 一.概念 如同标准库一般,也有容器(即集合类)和迭代器 void main() { // Populate the collection vector<long> rgPrimes; for (long n = 0; n !=... 阅读全文

ATL 对象映射表

2012-11-01 23:46 by Clingingboy, 1203 阅读, 收藏, 编辑
摘要: 一.作用 Each coclass adds an entry to the object map by allocating the _ATL_OBJMAP_ENTRY structure (discussed in detail shortly) within that same data segment. This produces a series of _ATL_OBJMAP_ENTR... 阅读全文

ATL学习笔记

2012-09-12 19:51 by Clingingboy, 638 阅读, 收藏, 编辑
摘要: 整理下 ATL 引用计数线程模型 ATL 临界区 ATL 核心COM继承类之CComObjectRootEx及CComObjectLock ATL 核心COM继承类之IDispatchImpl及调用 ATL COM类之激活 ATL 接口映射 A... 阅读全文

ATL COM类之激活

2012-09-09 00:06 by Clingingboy, 1764 阅读, 收藏, 编辑
摘要: 参考: ATL 核心COM继承类之CComObjectRootEx及CComObjectLock 背景 继承自CComObjectRootEx的类实际上并未实现IUnknown的三个方法,那么就得手动编写这三个方法 class CPenguin : public CComObjectRootEx<CComMultiThreadModel>, public IBird, ... 阅读全文

ATL 核心COM继承类之IDispatchImpl及调用

2012-09-07 13:42 by Clingingboy, 4251 阅读, 收藏, 编辑
摘要: 实现 先看IDispatch接口,如同反射 interface IDispatch : IUnknown { HRESULT GetTypeInfoCount([out] UINT * pctinfo); HRESULT GetTypeInfo([in] UINT iTInfo, [in] LCID lc... 阅读全文

ATL 核心COM继承类之CComObjectRootEx及CComObjectLock

2012-09-07 13:21 by Clingingboy, 2259 阅读, 收藏, 编辑
摘要: 参考: ATL 临界区 ATL 引用计数线程模型 CComObjectRootEx Manages reference counting for both aggregated and nonaggregated objects. Allows you to specify a threading model. ... 阅读全文

ATL 临界区

2012-09-07 11:38 by Clingingboy, 1564 阅读, 收藏, 编辑
摘要: CComAutoCriticalSection Contains methods for obtaining and releasing a critical section. The critical section is automatically initialized. CComCriticalSection Contains method... 阅读全文

ATL 引用计数线程模型

2012-09-07 11:28 by Clingingboy, 801 阅读, 收藏, 编辑
摘要: 只为记录 CComSingleThreadModel Provides methods for incrementing and decrementing a variable. Does not provide a critical section. CComMultiThreadModel Provides thread-safe methods for increment... 阅读全文

无注册表的COM调用

2012-08-21 11:19 by Clingingboy, 653 阅读, 收藏, 编辑
摘要: 跳过注册表部分 http://blog.csdn.net/problc/article/details/7428440 HRESULT WINAPI CreateCOMObject( LPCWSTR pstrDll, REFCLSID rclsid, REFIID riid, LPVOID* ppObject, IUnknown* pUnkOuter ){ if (ppObject... 阅读全文

WTL学习笔记(2)ToolBar && StatusBar

2011-08-08 17:47 by Clingingboy, 1093 阅读, 收藏, 编辑
摘要: 1.创建ToolBar和StatusBar LRESULT CMainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lPara... 阅读全文

WTL学习笔记(3)对话框和控件

2011-08-08 17:47 by Clingingboy, 1537 阅读, 收藏, 编辑
摘要: 1.初始化控件 int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine,... 阅读全文

WTL学习笔记(1)基础

2011-08-08 17:46 by Clingingboy, 1901 阅读, 收藏, 编辑
摘要: WTL基于ATL,并做了简化和封装 不同点 1.DECLARE_FRAME_WND_CLASS 原ATL:DECLARE_WND_CLASS封装了一个ATL::CWndClassInfo结构 DEC... 阅读全文

关于com套间的资料

2011-08-03 23:20 by Clingingboy, 516 阅读, 收藏, 编辑
摘要: 目前发现仅此一篇完整,不过国人可笑的是骂的人居多讨论的人却很少 http://www.vckbase.com/document/viewdoc/?id=1597 下面这个帖子的讨论也很精彩 http... 阅读全文

com 名字对象(3)使用IMoniker

2011-08-01 21:16 by Clingingboy, 1944 阅读, 收藏, 编辑
摘要: 一.名字对象比较 Hash和IsEqual方法 IMoniker* moniker2=NULL;CreateFileMoniker(OLESTR("F:\\test.xlsx"),&moniker2... 阅读全文

com 名字对象(2)创建名字对象(IMoniker)

2011-07-26 20:31 by Clingingboy, 2343 阅读, 收藏, 编辑
摘要: 1.文件名字对象 IUnknown* pUnk = NULL;IMoniker* moniker2=NULL;CreateFileMoniker(OLESTR("E:\\test.xlsx"),&m... 阅读全文

com 名字对象(1)IBindCtx

2011-07-26 20:30 by Clingingboy, 946 阅读, 收藏, 编辑
摘要: 一.IBindCtx Provides access to a bind context, which is an object that stores information about a pa... 阅读全文

ATL-固有属性(CStockPropImpl)

2011-07-20 22:53 by Clingingboy, 1411 阅读, 收藏, 编辑
摘要: 继承该类,派生类就可以支持一些固有属性 一实现方法 1.继承CStockPropImpl class ATL_NO_VTABLE CBullsEye : public CStockPropImpl<... 阅读全文

ActiveX控件实现相关资料

2011-07-19 23:00 by Clingingboy, 597 阅读, 收藏, 编辑
摘要: 一.IObjectSafety 浏览器安全等级 http://blog.csdn.net/sstower/article/details/6586687 二.IProvideClassInfo2 S... 阅读全文

Visual C++ 2011-07-18

2011-07-19 19:40 by Clingingboy, 651 阅读, 收藏, 编辑
摘要: 一.Keyboard Accelerators控件快捷键 参考:http://blog.csdn.net/Welson80/article/details/5808277 http://www.cn... 阅读全文