SAMPLE: Demo of Simple C Automation Component and Controller

Last reviewed: April 8, 1997
Article ID: Q138470
The information in this article applies to:
  • Microsoft OLE Libraries included with: - Microsoft Windows NT versions 3.5 and 3.51 - Microsoft Windows 95

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 Software Library:

 ~ Cautoex.exe (size: 49099 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

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.


Keywords : kbfile kbole kbsample LeTwoAto
Version : 3.5 3.51 4.0
Platform : NT WINDOWS


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: April 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.