Solved

Using OLE Automation

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 163
sameEnds challenge 3 180
Modbus - whats the maximum I can store in one register? 4 80
sumHeights2  challenge 7 117
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.
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.

839 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