• 大小: 18KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-10
  • 标签: COM  C语言  源码  

资源简介

简单使用纯C语言实现COM组件,帮助理解COM实现机制

资源截图

代码片段和文件信息

// C source code to a simple COM object compiled into an ordinary
// dynamic link library (DLL).

#include 
#include se.h>
#include “IExample.h“





// A count of how many objects our DLL has created (by some
// app calling our IClassFactory object‘s CreateInstance())
// which have not yet been Release()‘d by the app
static DWORD Outstandingobjects;

// A count of how many apps have locked our DLL via calling our
// IClassFactory object‘s LockServer()
static DWORD LockCount;












// The IExample object ////////////////////////////////////////////////////////////

// In our .H file we use a macro which defines our IExample struct
// as so:
//
// typedef struct {
//    IExampleVtbl  *lpVtbl;
// } IExample;
//
// In other wo

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       12212  2006-03-28 04:33  iexample\IExample.c
     文件          78  2006-03-27 00:29  iexample\IExample.def
     文件        4197  2006-03-27 01:34  iexample\IExample.dsp
     文件         539  2006-03-24 13:55  iexample\IExample.dsw
     文件         927  2006-03-27 22:06  iexample\IExample.h
     文件        1914  2006-03-27 23:41  iexampleapp\IExampleApp.c
     文件        4342  2006-03-24 13:57  iexampleapp\IExampleApp.dsp
     文件         545  2006-03-24 13:55  iexampleapp\IExampleApp.dsw
     文件        1811  2006-03-27 23:56  iexamplecplusapp\IExampleCPlusApp.cpp
     文件        4404  2006-03-27 23:57  iexamplecplusapp\IEXAMPLECPLUSAPP.dsp
     文件         555  2006-03-27 23:57  iexamplecplusapp\IEXAMPLECPLUSAPP.dsw
     文件        5635  2006-03-28 22:54  regiexample\RegIExample.c
     文件        3976  2006-03-24 14:05  regiexample\RegIExample.dsp
     文件         545  2006-03-24 14:05  regiexample\RegIExample.dsw
     文件        3050  2006-03-28 04:19  unregiexample\UnregIExample.c
     文件        4000  2006-03-24 14:07  unregiexample\UnregIExample.dsp
     文件         549  2006-03-24 14:05  unregiexample\UnregIExample.dsw

评论

共有 条评论