SAMPLE: TYPEBLD: How to Use ICreateTypeLib & ICreateTypeInfo

Last reviewed: June 5, 1996
Article ID: Q131105
The information in this article applies to:
  • Microsoft OLE Libraries for Windows and Win32s, version 2.03
  • Microsoft OLE libraries included with:

        - Microsoft Windows NT version 3.5
        - Microsoft Windows 95
    

SUMMARY

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

You can find TYPEBLD.EXE (size: 24832 bytes) 
                        , a self-extracting file, on these services:

  • Microsoft's World Wide Web site on the Internet

          On the www.microsoft.com home page, click the Support icon
          Click Knowledge Base, and select the product
    
          Enter kbfile TYPEBLD.EXE (size: 24832 bytes) 
                                  , and click GO!
          Open the article, and click the button to download the file
    
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the Softlib/Mslfiles folder
          Get TYPEBLD.EXE (size: 24832 bytes) 
    
  • The Microsoft Network

          On the Edit menu, click Go To, and then click Other Location
          Type "mssupport" (without the quotation marks)
          Double-click the MS Software Library icon
          Find the appropriate product area
          Locate and Download TYPEBLD.EXE
    
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download TYPEBLD.EXE (size: 24832 bytes) 
    

    For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

       ARTICLE-ID: Q119591
       TITLE     : How to Obtain Microsoft Support Files from Online Services
    
    
    See the README.TXT file included in the sample for instructions on to compile and run this sample.

    MORE INFORMATION

    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 reference words: 3.50 4.00
    KBCategory: kbole kbfile kbcode
    KBSubcategory: LeTwoAt


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: June 5, 1996
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.