Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using OLE Automation

Posted on 1999-01-20
4
Medium Priority
?
214 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 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

971 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