Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using OLE Automation

Posted on 1999-01-20
4
Medium Priority
?
212 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
[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
  • 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 80 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

670 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