只需要有接口定义不需要 coclass 定义。生成一个新的 GUID 给新的接口,然后复制一段 interface 的定义过来改动改动之后编译一下就可以啦。

解决方案 »

  1.   

    [
    uuid(861F856D-BE77-4212-95A3-02F2B679478A),
    version(1.0),
    helpstring("Test1 1.0 Type Library")
    ]
    library TEST1Lib
    {
    importlib("stdole32.tlb");
    importlib("stdole2.tlb");         *************;
             *************; [
    uuid(FE018945-9B2C-4414-8E39-2BD537CEF612),
    helpstring("Component1 Class")
    ]
    coclass Component1
    {
                      XXXXXXXXXXXXXXXXXXXXXXX;
                      XXXXXXXXXXXXXXXXXXXXXXX;
    [default] interface IComponent1;
    };
    };在XXXXXXXXXXXXXX, 或*******************的地方再把接口声明一遍就可以了。
      

  2.   

    例如
    [
    uuid(861F856D-BE77-4212-95A3-02F2B679478A),
    version(1.0),
    helpstring("Test1 1.0 Type Library")
    ]
    library TEST1Lib
    {
    importlib("stdole32.tlb");
    importlib("stdole2.tlb");interface IOtherInterface1;
    interface IOtherInterface2;[
    uuid(FE018945-9B2C-4414-8E39-2BD537CEF612),
    helpstring("Component1 Class")
    ]
    coclass Component1
    {
    [default] interface IComponent1;
    };
    }; 
      

  3.   

    自己在idl文件中手工添加,呵呵,这就是VC比Delphi更faint的地方