Next: Samples, Previous: Framework [Contents][Index]

## 3 GNATCOM Tools Overview

- MakeGUID

  Generates GUIDs (Global Unique IDs).

      Usage: MakeGUID Number_of_GUIDs

      C:\>MakeGUID
      {C41E5A70-F473-11D3-939E-0080C88637DE}
      C:\>MAKEGUID 3
      {C41E5A70-F473-11D3-939E-0080C88637DE}
      {C41E5A71-F473-11D3-939E-0080C88637DE}
      {C41E5A72-F473-11D3-939E-0080C88637DE}

- COMScope

  Generates documentation from type libraries (binary headers embedded in most COM objects).

      Usage: COMScope typelib

      typelib can be a type library file (.tlb) or any file with an embedded type
      library such as a COM object (.dll, .ocx, .exe)

      C:\>COMScope C:\winnt\system32\mshtml.tlb >IE5.txt
      C:\>COMScope C:\winnt\system32\msxml.dll >XML.txt

  Would produce a file IE5.txt describing all the types, objects, and methods in the mshtml.tlb type library or msxml COM object.

- BindCOM

  Generates bindings from type libraries embedded in COM objects or that describe DLLs (frequently developers package type libraries with regular DLLs.)

      Usage: BindCOM typelib base_package_name

      typelib can be a type library file (.tlb) or any file with an embedded
      type library such as a COM object (.dll, .ocx, .exe)

      or

      Usage: BindCOM typelib_GUID Major_Version Minor_Version

      typelib_GUID is the GUID for a type library, a LIBID. Major_Version is
      the major version of the the type library and minor version is the
      minimum minor version of the type library that should be used to
      generate a binding.

      C:\>BindCOM C:\winnt\system32\msxml.dll MSXML
      C:\>BindCOM {D63E0CE2-A0A2-11D0-9C02-00C04FC99C8E} 2 0

  Would both produce a file called MSXML.ads containing a thin binding to the MSXML COM object and MSXML-*_interface.ad?, MSXML-*_object.ad?, MSXML-*_event.ad? files with thick bindings to interfaces, dispinterfaces, and event interfaces respectively.

- CreateCOM

  Generates a complete COM object from type libraries requiring only function bodies to be filled in.

      Usage: CreateCOM typelib base_package_name

      typelib can be a type library file (.tlb) or any file with an embedded
      type library such as a COM object (.dll, .ocx, .exe)

      C:\>BindCOM MyProj.tlb MyProj.tlb

  Would produce the following files:

  1.     myproj-dll.ad?    - The InProc (Dll) implementation files

  2.     myproj-exe.adb    - The LocalServer (Exe) implementation files

  3.     myproj-remote.adb - An application that can register the COM object on remote machines.

  4.     myproj.ads        - Thin bindings and GUIDs

  5.     myprojrc.rc       - Windows resource file embedding the type library

  6.     make.bat          - Batch file that will compile the files

  There will be an additional spec and body for every COM object (CoClass) defined in the the type library in the format of myproj-*.ad?. Implementations of the COM objects are filled in to the function bodies in the myproj-*.adb files.

Next: Samples, Previous: Framework [Contents][Index]