資源簡介
簡單使用純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
評論
共有 條評論