System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article was previously published under Q181473
If you need to program in C, rather than C++, OLE Automation can be
difficult because the Component Object Model (COM), the building blocks of
OLE, was designed around the binary layout of a C++ class. The header files
included by WINDOWS.H, however, have built-in support for C compilations;
therefore, you can mimic the behavior of a C++ object and make OLE
Automation calls. This article describes how to build a Win32 console
application, using C, that starts up Microsoft Excel and makes it visible
via OLE Automation.
For more general information regarding OLE, COM, and Automation, consult
the book "Inside OLE" by Kraig Brockschmidt (Microsoft Press).
For more information about IDispatch, consult the Microsoft Visual C++
online help.
For more information about COM, OLE, and automating Microsoft Excel using
Microsoft Visual C++, see Chapters 23-27 of the book "Inside Visual C++" by
David J. Kruglinski (Microsoft Press).
(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Joe Crump, Microsoft Corporation.