SAMPLE: TYPEBLD: How to Use ICreateTypeLib & ICreateTypeInfo

ID: Q131105


The information in this article applies to:
  • Microsoft OLE Libraries for Windows and Win32s, version 2.03
  • Microsoft OLE Libraries, used with:
    • Microsoft Windows NT 3.5
    • Microsoft Windows 95


SUMMARY

The TYPEBLD sample demonstrates how to create an OLE Automation type library using the ICreateTypeLib and ICreateTypeInfo interfaces.


MORE INFORMATION

The following file is available for download from the Microsoft Download Center. Click the file name below to download the file:

Typebld.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

See the README.TXT file included in the sample for instructions on how to compile and run this sample.

The type library that is created is called HELLO.TLB and corresponds to one that would have been built by MKTYPLIB.EXE if it had compiled the following .ODL file.

Sample .ODL File


   [
     uuid(2F6CA420-C641-101A-B826-00DD01103DE1),            // LIBID_Hello
     helpstring("Hello 1.0 Type Library"),
     lcid(0x0409),
     version(1.0)
   ]
   library Hello
   {
   #ifdef WIN32
       importlib("stdole32.tlb");
   #else
       importlib("stdole.tlb");
   #endif
   
       [
         uuid(2F6CA422-C641-101A-B826-00DD01103DE1),        // IID_IHello
         helpstring("Hello Interface")
       ]
       interface IHello : IUnknown
       {
           [propput] void HelloMessage([in] BSTR Message);
           [propget] BSTR HelloMessage(void);
           void SayHello(void);
       }
       [
         uuid(2F6CA423-C641-101A-B826-00DD01103DE1),        // IID_DHello
         helpstring("Hello Dispinterface")
       ]
       dispinterface DHello
       {
         interface IHello;
       }
   
       [
          uuid(2F6CA421-C641-101A-B826-00DD01103DE1),       // CLSID_Hello
          helpstring("Hello Class")
       ]
       coclass Hello
       {
           dispinterface DHello;
           interface IHello;
       }
   } 

Additional query words: kbole kbfile

Keywords : kbole kbsample kbAutomation kbNTOS350 kbOLE200 kbWinOS95 kbGrpCom kbDSupport LeTwoAt
Version : WINDOWS:2.03,95; :
Platform : WINDOWS
Issue type :


Last Reviewed: December 7, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.