Solved

Using OLE Automation Objects

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
while loop over for loop 7 80
MaxSpan challenge 9 68
sumHeights  challenge 17 61
Best way to accomplish this task? 3 77
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
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…

747 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

11 Experts available now in Live!

Get 1:1 Help Now