Solved

Using OLE Automation Objects

Posted on 1999-01-20
5
238 Views
Last Modified: 2013-11-25
I am integrating a product called BackWeb which is an OLE Automation Object in the form of an .exe.  How do I import or use an object like this?  In the OLE/COM viewer I can see the Object as an Active Template Library but I can't find out how to use it.

Thanks,
  Blake
0
Comment
Question by:bjstorey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:bjstorey
ID: 1328037
Adjusted points to 150
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 150 total points
ID: 1328038
You can use #import on an .EXE and it will try to generate the wrappers for it if and only if there is type library information in the .EXE.

If there isn't then you will need to build it yourself. In which case, using COleDispatchDriver is your best friend. Take a look at the documentation for the class on how to use it. There are samples that shipped with MFC that use this class: CalcDriv and ACDual.


0
 

Author Comment

by:bjstorey
ID: 1328039
That imported the information but how do I actually call one of these objects.  I have tried CoCreateInstance but I can't get the right Interface ID
0
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1328040
You need to use

  IDispatch* dispatch = NULL;
  HRESULT hr = CoCreateInstance(clsId, NULL, CLSCTX_SERVER, IID_IDispatch, (void**)&dispatch);

The clsId is available through the registry or using CLSIDFromProgID().
0
 

Author Comment

by:bjstorey
ID: 1328041
Thanks again...I have that now also.  I have a specific Interface I want to get now called IBackWeb.  How do I get at that interface?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question