Solved

Using OLE Automation Objects

Posted on 1999-01-20
5
212 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sameEnds challenge 3 136
How to deal with "Consider using Code First Migrations to update the database" ? 7 219
has22 challenge 11 80
FizzBuzz challenge 9 77
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
In this article you will learn how to create a free basic website on Bitbucket, a git service provider. Polymer creates dynamic HTML components, which allow more flexibility than static HTML. This tutorial uses Ubuntu Linux but can also be done on W…
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…

864 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now