Solved

Using OLE Automation

Posted on 1999-01-20
4
205 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
GIF file bit manipulation for color change 5 107
sum28 challenge 31 105
Change to event 1 99
Way to decrease size of apk file 9 40
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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

929 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

10 Experts available now in Live!

Get 1:1 Help Now