Ten, myproj_i.c
Code selection
/ * this file contains the actual definitions of * /
/ * The IIDS and CLSIDS * /
/ * LINK this file in with the server and any clients * /
/ * File Created by MIDL Compiler Version 5.01.0164 * /
/ * at sun NOV 30
23:39:23
2003
* /
/ * Compiler settings for c: /myproj/myproj.idl:
OICF (OPTLEV = I2), W1, ZP8, ENV = WIN32, MS_EXT, C_EXT
Error Checks: Allocation Ref Bounds_Check Enum Stub_Data
* /
@@ MIDL_FILE_HEADING ()
#ifdef __cplusplus
Extern "C" {
#ENDIF
#ifndef __iid_defined__
#define __iid_defined__
TypedEf struct_iid
{
Unsigned long x;
UNSIGNED SHORT S1;
UNSIGNED SHORT S2;
UNSIGNED CHAR C [8];
} IID;
#ENDIF / / __IID_DEFINED__
#ifndef clsid_defined
#define CLSID_DEFINED
Typedef Iid CLSID;
#ENDIF // CLSID_DEFINED
Const IID IID_IMYCOM = {0x65460F9C, 0x3BAb, 0x4055, {0x88, 0x5A, 0x8E, 0xD5, 0x9F, 0x5F, 0XA9, 0XB0}
Const IID libid_myprojlib = {0xFe651184, 0x11de, 0x4d01, {0xBD, 0x69, 0xB0, 0X7D, 0xDF, 0XA1, 0X2D, 0x0c}}
Const CLSID CLSID_MYCOM = {0xFeb7BDEF, 0xFB6F, 0x446B, {0xBe, 0x31, 0xDF, 0x0A, 0x3A, 0XD3, 0X91, 0XBA}}
#ifdef __cplusplus
}
#ENDIF
Eleven, mycom.rgs
Code selection
HKCR
{
MyProj.mycom.1 = s 'mycom class'
{
CLSID = S '{Feb7BDEF-FB6F-446B-BE31-DF0A3AD391BA}'
}
MyProj.mycom = s 'mycom class'
{
CLSID = S '{Feb7BDEF-FB6F-446B-BE31-DF0A3AD391BA}'
Curver = s 'myproj.mycom.1'
}
Noremove CLSID
{
Forceremove {Feb7BDEF-FB6F-446B-BE31-DF0A3AD391BA} = s 'Mycom Class'
{
PROGID = s 'myproj.mycom.1'
VersionIndependentProgid = s 'myproj.mycom'
Forceremove 'programable'
InprocServer32 = S '% module%'
{
Val threadingmodel = s 'apartment'
}
'TypeLib' = s '{FE651184-11DE-4D01-BD69-B07DDFA12D0C}'
}
}
}
Code analysis
When the component registers, here you can change the components of the component in the registration table and other relevant registration information in the registry.
Developing COM Components Using VC-ATL (2)
Author Blog:
http://blog.9cbs.net/callzjy/