home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / oleaut / browseh / readme.txt < prev    next >
Encoding:
Text File  |  1997-03-18  |  4.4 KB  |  130 lines

  1. OLE Automation Controller and Server that Browses a Type Library
  2.  
  3.  
  4. SUMMARY
  5. =======
  6.  
  7. The BROWSE sample controls the automation objects of the BROWSEH (Browse 
  8. Helper) inproc server to browse a type library. BROWSE is a developer-
  9. oriented type library browser. 
  10.  
  11. In addition to displaying type library information, this sample shows how 
  12. to control an automation object by accessing its properties and methods.
  13. BROWSE provides generic helper functions (CreateObject & Invoke) to control
  14. any automation server. For more information on how to use these functions,
  15. see the comments in INVHELP.CPP.
  16.  
  17. BROWSEH exposes a number of automation objects that correspond to 
  18. components of a type library. This allows an automation controller like 
  19. BROWSE to access the properties and methods of these objects to browse the 
  20. type library instead of directly using ITypeLib and ITypeInfo. So BROWSEH 
  21. is a type library browse helper. BROWSEH does not support vtable binding.
  22. Controllers must use IDispatch to control this server. 
  23.  
  24. MORE INFORMATION
  25. ================
  26.  
  27. The following information describes the BROWSE sample.
  28.  
  29. To Compile BROWSE and BROWSEH
  30. -----------------------------
  31.  
  32. To compile an ANSI debug version of the sample for Windows NT and Windows 95,
  33. use the following command:
  34.  
  35.    nmake
  36.  
  37. To compile a Unicode debug version of the sample for Windows NT only, use the
  38. following command:
  39.  
  40.    nmake dev=win32 HOST=NT
  41.  
  42. To compile a 16-bit debug version of the sample and if your development
  43. environment is Win 3.x, use the following command. If your development
  44. environment is Win95 or NT, change the HOST appropriately.
  45.  
  46.    nmake dev=win16 HOST=DOS
  47.  
  48. To clean up between builds which use different options, use one of the
  49. following commands:
  50.  
  51.    nmake clean
  52.    nmake dev=win16 clean
  53.  
  54. See the makefile header comments for other make options.
  55.  
  56. If one of the build tools cannot find SDKUTIL.LIB, use the SAMPLES\COM\COMMON
  57. sample to build SDKUTIL.LIB.
  58.  
  59. Visual C++ 2.x and above can use makefile as an external makefile 
  60. after making the following replacement in the makefile:
  61.  
  62.    !include <$(MSTOOLS)\samples\com\include\olesampl.mak>
  63.  
  64. with
  65.  
  66.    !include <win32.mak>
  67.  
  68.  
  69. To Run BROWSE
  70. -------------
  71.  
  72.  - Change BROWSEH.REG to provide the full path of BROWSEH.DLL,    BROWSEH.TLB and MYDISP.TLB. 
  73.  
  74.  - Register BROWSEH.REG in the registration database by double-clicking it.
  75.  
  76.  - Run BROWSE.EXE and use the menu to select a type library to browse.
  77.  
  78.  
  79. BROWSE Files
  80. ------------
  81.  
  82. INVHELP.CPP and INVHELP.H contain two helper functions that are used to 
  83. create an automation object (using CreateObject) and to invoke a method 
  84. or property of that object (using Invoke). These functions are general 
  85. enough to be used by any Automation controller.
  86.  
  87. BROWSE.CPP uses the helper functions in invhelp.cpp to access the 
  88. properties and methods of the automation objects of BROWSEH. 
  89.  
  90. MAKEFILE is the makefile for the project.
  91.  
  92.  
  93. To run BROWSEH
  94. --------------
  95.  
  96.  - Change BROWSEH.REG to provide the full path of BROWSEH.DLL and BROWSEH.TLB.
  97.  
  98.  - Register BROWSEH.REG in the registration database by double-clicking it.
  99.  
  100.  - Run the Automation controller BROWSE that uses BROWSEH to browse a type
  101.    library OR load and run the VB 4.0 VB.VBP project file which uses BROWSEH
  102.    to output a C/C++ header file from the infromation in a type library. The
  103.    header file can be used to create a C/C++ vtbl-binding client for the server
  104.    to which the type library belongs, if the server supports vtbl-binding. After
  105.    running the VB script, select the type library to be used as the input and
  106.    specify the name of the header file to be output.
  107.  
  108. BROWSEH Files
  109. -------------
  110.  
  111. MYDISP.ODL contains the description of a base class that implements 
  112. IDispatch. All automation objects in this server are derived from this 
  113. class. This is the implementation of IDispatch in the base class to be 
  114. inherited in the derived classes.
  115.  
  116. BROWSEH.ODL contains the description of the objects that BROWSEH exposes.
  117.  
  118. TLB.H is the header file generated by mktyplib.exe
  119.  
  120. MAKEFILE is the makefile for project.
  121.  
  122. MAIN.CPP contains code to create an inproc server.
  123.  
  124. Other files implement the BROWSEH automation server. For example,
  125. COCLASS.CPP demonstrates how to use ITypeInfo and ITypeLib to browse a 
  126. coclass in a type library.
  127.  
  128. VB.VBP and VB.FRM are VB 4.0 files that uses BROWSEH to browse a type library
  129. and to create a C/C++ header file from the browsed information.
  130.