So I am trying to write a program that will instantiate and control a COM object, in this case a telescope dome simulator (DomeSim.exe). So for example, if I tell the program to park the dome, the simulator will park etc. Using COM in C++ is quite annoying and difficult, and at the moment I am just trying to implement one method, and even still I can't tell if I'm doing it right as I'm just going off online tutorials and examples. Here is the Code below.
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include <windows.h>
#include <C:\Users\Usman-Khan\Desktop\dome_script\DomeSimulator.h>
#import <C:\Users\Usman-Khan\Desktop\dome_script\DomeSim.exe>
So the main method I'm trying to get to use atm is the get_AtHome method, which should be simple enough. I just want to know if I am going about this the right way, and what I need to do to fix it as COM is quite confusing.
Using the #import directive is the accepted way to go about it in C++.
I wish I could help, as I'm kind of a COM guy, but I don't do it that way. I use my own rather low level direct techniques, which wouldn't work for you unless you've devoted your life to COM, as I have :).
The person here who's knowledgable about using the #import directive with COM in C++ is Andy Weskin. Possibly others too, but I know Andy is real familiar with it. He might be busy and not have the time to help though. About the only help I can offer is the suggestion to learn how to use code tags. Nobody wants to look at unformatted code.
that that you'd put here doesnt looks like ole
real ole looks like that http://fullproject.googlecode.com/svn/trunk/code/SDK/WinAPI%20Programming/CHAP20/
Code from Petzold book
bool DomeSimulator::get_AtHome() const
.......
bool home = &DomeSimulator::get_AtHome
not bad
You just can try to invoke something like "microsoft rich textbox" to begin. For example