• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

Sink to ActiveX control from WebBrowser View

I embeded an ActiveX (MSCOMCTL.OCX TreeView) control in to my HTML resource. <OBJECT> </OBJECT> I then LoadResource(xxxx); on it. It displays okay, and I can set nodes, but how do I get the ITreeViewEvents in my CHTMLView derived class. I tried setting up a connectionpoint, but the object does not respond to the following code

IDispatch *pObjdisp = NULL;
IConnectionPointContainer *pConnCon = NULL;
IConnectionPoint *pConn = NULL;

pObjElem->get_object(&pObjdisp);
pObjdisp->QueryInterface(IID_IConnectionPointContainer, (void **)&pConnCon);
pConnCon->FindConnectionPoint(IID_IConnectionPoint, &pConn);

//next call advise on pConn


pConn is always NULL. Is there a better way to sync with an ActiveX control in this situation.

Thanks,
Tony.
0
Tony_Sebastian
Asked:
Tony_Sebastian
1 Solution
 
GlennDeanCommented:
Tony:
   You don't call FindConnectionPoint with IID_IConnectionPoint, but rather the IID of the interface that the client has implemented.  For ex,
pConnCon->FindConnectionPoint(IID_IMySinkInterface,&pConn);

   pConn will then be set to the server's implementation for the connection point for that very particular IID_IMySinkInterface.  You then call Advise on pConn to add your implementation of IMySinkInterface to the one or more clients who have sent in their implementations of the interface to the server.

   Glenn
0
 
Tony_SebastianAuthor Commented:
I tried that before. After reading your comment I tried again and realized I was using the IID for the wrong Treeview version.

Thanks,
Tony.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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