Click here to Skip to main content
15,899,679 members
Home / Discussions / COM
   

COM

 
QuestionCOM+ Pin
AnhTin13-Oct-06 23:15
AnhTin13-Oct-06 23:15 
AnswerRe: COM+ Pin
Steve S16-Oct-06 21:35
Steve S16-Oct-06 21:35 
QuestionMFC ActiveX Control Errors Pin
Stober13-Oct-06 9:48
Stober13-Oct-06 9:48 
AnswerRe: MFC ActiveX Control Errors Pin
Stober13-Oct-06 11:51
Stober13-Oct-06 11:51 
QuestionNeed Directshow Sample Pin
Manjunath S13-Oct-06 8:24
Manjunath S13-Oct-06 8:24 
QuestionHow to load XSD files using VC++ Pin
vgkotha12-Oct-06 20:18
vgkotha12-Oct-06 20:18 
AnswerRe: How to load XSD files using VC++ Pin
Hamid_RT18-Oct-06 19:33
Hamid_RT18-Oct-06 19:33 
QuestionMaking connection points work with MFC Pin
garyflet12-Oct-06 7:51
garyflet12-Oct-06 7:51 
I have successfully made a DCOM client and server, the client can call functions on the server. My trouble is trying to use MFC to create a connection point so that the server can call a function on the client.

On the client side I created a class ISimpCliAuto derived from COleDispatchDriver that has the exposed functions of the server. This class has a clsid, IID_ISimpCliAuto.

On the server side I have the following macros in the header file of the exposed class, CSimpServDlgAutoProxy:

BEGIN_CONNECTION_PART(CSimpServDlgAutoProxy, Alert)
CONNECTION_IID(IID_ISimpCliAuto)
END_CONNECTION_PART(Alert)

DECLARE_CONNECTION_MAP()

In the SimpServDlgAutoProxy.cpp I have the macros

BEGIN_CONNECTION_MAP(CSimpServDlgAutoProxy, CCmdTarget)
CONNECTION_PART(CSimpServDlgAutoProxy, IID_ISimpCliAuto, Alert)
END_CONNECTION_MAP()

On the client side I call CoCreateInstanceEx() and get an LPUNKNOWN m_pUnkServ. I call m_pUnkServ->QueryInterface() to get an LPDISPATCH which I can use in AttachDispatch(LPDISPATCH) and call exposed functions on the server side. I do not call m_pUnkServ->Release() at this point.

The problem occurs when I attempt to use m_pUnkServ in AfxConnectionAdvise(m_pUnkServ,...). The failure occurs within at the call

LPCONNECTIONPOINTCONTAINER pCPC;

HRESULT hr = m_pUnkServ->QueryInterface(IID_IConnectionPointContainer,(LPVOID*)&pCPC);

The hr indicates "No such interface supported." This is the result locally as well as over a network. The interface in question I think is the connection point container. But isn't all that supported by the macros above in the server? What am I doing wrong?
QuestionPass BSTR with Connection point. Pin
HakunaMatada12-Oct-06 3:13
HakunaMatada12-Oct-06 3:13 
AnswerRe: Pass BSTR with Connection point. Pin
Jonathan [Darka]12-Oct-06 4:15
professionalJonathan [Darka]12-Oct-06 4:15 
GeneralRe: Pass BSTR with Connection point. Pin
Steve S12-Oct-06 6:42
Steve S12-Oct-06 6:42 
GeneralRe: Pass BSTR with Connection point. Pin
Jonathan [Darka]12-Oct-06 10:24
professionalJonathan [Darka]12-Oct-06 10:24 
GeneralRe: Pass BSTR with Connection point. Pin
Steve S12-Oct-06 21:36
Steve S12-Oct-06 21:36 
GeneralRe: Pass BSTR with Connection point. [modified] Pin
HakunaMatada12-Oct-06 18:16
HakunaMatada12-Oct-06 18:16 
GeneralRe: Pass BSTR with Connection point. Pin
Jonathan [Darka]12-Oct-06 21:27
professionalJonathan [Darka]12-Oct-06 21:27 
GeneralRe: Pass BSTR with Connection point. Pin
Lim Bio Liong13-Oct-06 8:27
Lim Bio Liong13-Oct-06 8:27 
GeneralRe: Pass BSTR with Connection point. Pin
HakunaMatada15-Oct-06 17:59
HakunaMatada15-Oct-06 17:59 
GeneralRe: Pass BSTR with Connection point. Pin
Lim Bio Liong15-Oct-06 21:44
Lim Bio Liong15-Oct-06 21:44 
GeneralRe: Pass BSTR with Connection point. Pin
HakunaMatada15-Oct-06 22:41
HakunaMatada15-Oct-06 22:41 
QuestionRecovering Deleted Messages(MAPI) Pin
neha.agarwal2711-Oct-06 20:33
neha.agarwal2711-Oct-06 20:33 
QuestionWeb Browser Development question: How can i get the href url before IMG tag. Pin
Tarloy.Ding10-Oct-06 23:56
Tarloy.Ding10-Oct-06 23:56 
QuestionWeb Service Client with complexType Pin
guilhermesmi9-Oct-06 10:37
guilhermesmi9-Oct-06 10:37 
Questionprblem with cocreateinstance ....! Pin
Sakthiu9-Oct-06 1:19
Sakthiu9-Oct-06 1:19 
AnswerRe: prblem with cocreateinstance ....! Pin
prasad_som9-Oct-06 1:43
prasad_som9-Oct-06 1:43 
GeneralRe: prblem with cocreateinstance ....! Pin
Sakthiu9-Oct-06 1:51
Sakthiu9-Oct-06 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.