Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

ATL: using connectable object in C++ client.

Hi,
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 ?

thanks,
yoav.

0
yoavo
Asked:
yoavo
1 Solution
 
yoavoAuthor Commented:
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++)
          {
               pT->Lock();
               CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
               pT->Unlock();
               _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"...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now