Solved

Using OLE Automation Objects

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mapAB Challlenge 35 185
Problem to event 3 123
Microsoft C++ code failing in executable that worked 9 144
Please explain "Multi-Tenant Services" 5 123
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…

739 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