Simple OLE Automation Server


SUMMARY
=======

The HELLO sample is a simple OLE Automation server. This is a good sample
to use to learn to create your first OLE Automation server. This sample has
a Hello Object that supports the HelloMessage Property and the SayHello 
method.

MORE INFORMATION
================

This sample implements the following features:

  - Dual interfaces which allow access of automation properties and methods 
   through vtable binding and through IDispatch. 

  - Rich Error information for vtable-binding controllers. This is done by
    implementing ISupportErrorInfo and using IErrorInfo.

  - Active object registration, using RegisterActiveObject and
    RevokeActiveObject. 

  - Correct shut-down behavior.

  - A registry file containing Hello.Application and Hello.Application.2
    as progIDs.

  - Initial invisibility.

To compile:
-----------

To compile an ANSI debug version of the sample for Windows NT and Windows 95,
use the following command:

   nmake

To compile a Unicode debug version of the sample for Windows NT only, use the
following command:

   nmake dev=win32 HOST=NT

To compile a 16-bit debug version of the sample and if your development
environment is Win 3.x, use the following command. If your development
environment is Win95 or NT, change the HOST appropriately.

   nmake dev=win16 HOST=DOS

Also modify the .REG file to use 16 bit version of the keys. For example
use LocalServer instead of LocalServer32.

To clean up between builds which use different options, use one of the
following commands:

   nmake clean
   nmake dev=win16 clean

See the makefile header comments for other make options.

If one of the tools cannot find SDKUTIL.LIB, use the SAMPLES\OLE\COMMON sample
to build SDKUTIL.LIB.

Visual C++ 2.x and above can use makefile as an external makefile 
after making the following replacement in the makefile:

   !include <$(MSTOOLS)\samples\ole\include\olesampl.mak>

with

   !include <win32.mak>


To run:
-------

Change hello.reg to provide the full path of hello.exe and hello.tlb.
Register hello.reg in the registration database by double-clicking it.
The HELLCTRL directory contains a controller that will control HELLO using
vtable-binding.

The following VB 4.0 script can also be used to control HELLO:

'Use the Tools/References menu to select the Hello type library before
'running this code.

Dim HelloObj As New Hello.Hello 'Hello.Hello is the libraryname.coclassname. If
                                'the coclass name was not the same as the library name
                                'Dim HelloObj As New Hello could have been used.
                                'The type of HelloObj is declared as the default
                                'interface in the coclass (IHello). The properties/methods of
                                'the IHello interface can be invoked using HelloObj.
                                                                
                                'You can also use
                                'Dim HelloObj As IHello
                                'Set HelloObj = New Hello.Hello
Private Sub SetVisible_Click()
    HelloObj.Visible = True                   'Set the visible property
End Sub
Private Sub Get_HelloMsg_Property_Click()
       Debug.Print HelloObj.HelloMessage     'Get the HelloMessage property
End Sub
Private Sub Set_HelloMsg_Property_Click()
       HelloObj.HelloMessage = "Hello Universe" 'Set the HelloMessage property
End Sub
Private Sub Invoke_SayHello_Method_Click()
       HelloObj.SayHello                     'Invoke the Hello method
End Sub


Files
-----

HELLO.ODL  Object description language that describes the property and 
method that HELLO exposes.

TLB.H  Header file generated by mktyplib.exe.

MAKEFILE  Makefile for project.

Other files implement the HELLO automation server.
