Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

SAMPLE: TYPEBLD: How to Use ICreateTypeLib & ICreateTypeInfo


View products that this article applies to.

This article was previously published under Q131105

↑ Back to the top


Summary

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

↑ Back to the top


More information

The following file is available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

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;
       }
   }
				

↑ Back to the top


Keywords: kbdownload, kbautomation, kbsample, KB131105

↑ Back to the top

Article Info
Article ID : 131105
Revision : 6
Created on : 3/3/2005
Published on : 3/3/2005
Exists online : False
Views : 668