现在的位置: 首页 > 综合 > 正文

ODL文件在注册表中的注册信息

2012年02月06日 ⁄ 综合 ⁄ 共 1934字 ⁄ 字号 评论关闭

[
  uuid(F37C8060-4AD5-101B-B826-00DD01103DE1),              // LIBID_Hello
  helpstring("Hello 2.0 Type Library"),
  version(2.0)
]
library Hello
{
#ifdef WIN32
    importlib("stdole2.tlb");
#else
    importlib("stdole.tlb");
#endif
    [
      uuid(F37C8062-4AD5-101B-B826-00DD01103DE1),          // IID_IHello                      
      helpstring("Application object for the Hello application."),  
      oleautomation,
      dual
    ]
    interface IHello : IDispatch                        
    {
        [propget, helpstring("Returns the application of the object.")]
        HRESULT Application([out, retval] IHello** retval);
        [propget, helpstring("Returns the full name of the application.")]
        HRESULT FullName([out, retval] BSTR* retval);
        [propget, id(0), helpstring("Returns the name of the application.")]
        HRESULT Name([out, retval] BSTR* retval);
        [propget, helpstring("Returns the parent of the object.")]
        HRESULT Parent([out, retval] IHello** retval);
        [propput]
        HRESULT Visible([in] VARIANT_BOOL VisibleFlag);
        [propget, helpstring("Sets or returns whether the main window is visible.")]
        HRESULT Visible([out, retval] VARIANT_BOOL* retval);
        [helpstring("Exits the application.")]
        HRESULT Quit();
        [propput, helpstring("Sets or returns the hello message to be used.")]
        HRESULT HelloMessage([in] BSTR Message);        
        [propget]
        HRESULT HelloMessage([out, retval] BSTR *retval);
        [helpstring("Say Hello using HelloMessage.")]       
        HRESULT SayHello();       
    }
    [
       uuid(F37C8061-4AD5-101B-B826-00DD01103DE1),          // CLSID_Hello
       helpstring("Hello Class"),
       appobject
    ]                                            
    coclass Hello
    {  
        [default]          interface IHello;
                           interface IDispatch;
    }
}

其中library指的是library type,它记录在HKEY_CLASSES_ROOT\TypeLib,在XX_i.c中用LIBID_XXLib表示

interface记录的是借口,它记录在HKEY_CLASSES_ROOT\Interface,在XX_i.c中用IID_IXX表示

coclass记录的事CLSID,它记录在HKEY_CLASSES_ROOT\CLSID,在XX_i.c中用CLSID_XX表示

【上篇】
【下篇】

抱歉!评论已关闭.