SAMPLE: Demo of Simple C Automation Component and Controller

ID: Q138470


The information in this article applies to:
  • Microsoft OLE Libraries, used with:
    • Microsoft Windows NT, versions 3.5, 3.51, 4.0
    • Microsoft Windows 95
    • Microsoft Windows 2000


SUMMARY

The Cautoex samples illustrate how to write a simple OLE Automation component (Cauto) and simple Automation controller (Cautocon) in C.

The following file is available for download from the Microsoft Download Center. Click the file name below to download the file:

Cautoex.exe
For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

NOTE: After downloading Cautoex.exe, use the -d option to extract the files so that they go into the correct directory structure. In other words, place Cautoex.exe in an empty directory, and run it by using this command:
cautoex -d


MORE INFORMATION

Cautoex.exe contains the following two sample applications:

  • Cauto is a local OLE Automation component sample application written in C. It contains a dialog box that prompts for text and a position to display that text on the main window. It exports, using OLE Automation, the text property as well as methods to get and set the position of the text and to refresh the main window of the component. A dual interface is used to support all of the automation. This dual interface is described in the object definition language file CAUTO\cauto.odl. IDispatch::GetIdsOfNames and IDispatch::Invoke simply call DispGetIDsOfNames and DispInvoke respectively.


  • Cautocon is a simple OLE Automation controller written in C that controls the Cauto application. There is a dialog that prompts for text and position. Cautocon then uses OLE Automation to draw that text at the appropriate position on the component's main window. This dialog box is activated by clicking Set on the Text menu. It is loaded with the text and position from the component's main window each time it is activated.


Additional query words:

Keywords : kbfile kbole kbsample kbAutomation kbNTOS350 kbNTOS351 kbNTOS400 kbWinOS2000 kbGrpCom kbDSupport LeTwoAto
Version : :
Platform : NT WINDOWS
Issue type :


Last Reviewed: December 4, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.