Solved

Using OLE Automation

Posted on 1999-01-20
4
204 Views
Last Modified: 2013-11-20
Here is what I have so far...

IDispatch*      pDisp = NULL;
CLSID            CLSID_BackWeb;

CLSIDFromProgID(OLESTR("BackWeb"),&CLSID_BackWeb);
Hr =CoCreateInstance(CLSID_BackWeb,NULL,CLSCTX_SERVER,IID_IDispatch,(void**)&pDisp);

What I want to do now is access a specific Interface called IBackWeb.  From that I will call a method that will return another object interface called IBackWebChannelCollection.  Then I will obtain an IBackWebChannel from the ChannelCollection.

How do I access this specific interface?

Thanks,
   Blake
0
Comment
Question by:bjstorey
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1328055
Assuming CoCreateInstance() succeeded(), you can use

  IBackWeb* ibw = NULL;
  hr = pDisp->QueryInterface(IID_IBackWeb, (void**)&ibw);
  if (SUCCEEDED(hr))
  {
    // Use IBackWeb here
    IBackWebChannel* iChannel = NULL;
    iChannel = ibw->ReturnMeABackWebChannel();
    // Use iChannel here
  }


0
 

Author Comment

by:bjstorey
ID: 1328056
The compiler is not finding IBackWeb as a type and it is not finding IID_IBackWeb.  What would be causing this?
0
 

Author Comment

by:bjstorey
ID: 1328057
The compiler is not finding IBackWeb as a type and it is not finding IID_IBackWeb.  What would be causing this?
0
 

Accepted Solution

by:
bheld earned 40 total points
ID: 1328058
You likely are not including the output from the compiling the .odl file in your server into your client's project.  Compiling the .odl file in the server will produce 2 files (a GUIDS.h and a *_i.c file).  You need to set up the project (project setttings for the .odl file so these files are created).  The client should then know about these interfaces.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ODBC Connection Logging, ADO.NET 6 50
WinWaitActive parameters 12 31
ShiftLeft challenge 21 66
Unix Command -- Challenging  question 7 79
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

743 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

14 Experts available now in Live!

Get 1:1 Help Now