Microsoft KB Archive/138470

= SAMPLE: Demo of Simple C Automation Component and Controller =

Article ID: 138470

Article Last Modified on 8/9/2004

-

APPLIES TO

 Microsoft OLE 4.0, when used with:  Microsoft Windows NT 4.0

 Microsoft Windows NT 3.51 Service Pack 5

 Microsoft Windows NT 4.0

 Microsoft Windows 95</li></ul>

 Microsoft Windows 2000 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q138470

<div class="summary_section">

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:

Cautoex.exe

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

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

<div class="moreinformation_section">

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: Cautoex

Keywords: kbdownload kbfile kbautomation kbsample KB138470

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.