ATL: using connectable object in C++ client.

Posted on 2003-03-24
Medium Priority
Last Modified: 2013-11-25
I have a Server application which have a COM object which supports events handling (connectable object).
I created a VB client which create an object of my class and handle these events and it works OK.
my problem is that when I try to write the client in c++, I do not get the events.
I was the method AtlAdvise inorder to create a connection between the connection point of the object and the sink of the client.
I debugged the code of firing the event from the server, and found out that in the call for "Invoke" method (in the CProxy class), I get the Error: "Member not found"

Can anyone advise ?


Question by:yoavo
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
LVL 48

Accepted Solution

AlexFM earned 480 total points
ID: 8194606

Author Comment

ID: 8200624
I tried the sample and it works fine. The difference between the sample and my application is that in the sample, the call to the event (in the ConnectionPoint header file) is done directly and not by IDispatch::Invoke method as in my application:
This is the sample:
     HRESULT Fire_ExecutionOver(INT Result)
          HRESULT ret;
          T* pT = static_cast<T*>(this);
          int nConnectionIndex;
          int nConnections = m_vec.GetSize();
          for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
               CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
               _IAddEvents* p_IAddEvents = reinterpret_cast<_IAddEvents*>(sp.p);
               if (p_IAddEvents != NULL)
                    ret = p_IAddEvents->ExecutionOver(Result);
          }     return ret;

I need to work with Dispatch methods, but I get the Error message "Member not found"...

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

801 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