Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AfxConnectionAdvise() fails (returns 0)

Status
Not open for further replies.

comshak

Programmer
Oct 9, 2002
1
US
Does anybody know why a call to AfxConnectionAdvise() would fail (return FALSE) when server and client programs run on different computers?

Everything works fine when client and server are being run locally (on the same computer), but I get FALSE as a result when calling AfxConnectionAdvise() like this:

//--------------

IUnknown* pUnk = NULL;
CComPtr<IUnknown> spUnk = pIMyServer; // pIMyServer is a pointer to my running remote object
pUnk = spUnk.p;

AfxConnectionAdvise(pUnk, DIID__IMyServerEvents, m_pDIPServerEventsUnk, TRUE, &dwCookie); // returns 0

//--------------

Is this a problem of badly setting my server (from dcomcnfg, for example)?
Because there is absolutely no problem locally, just when client runs remotely. It is kind of weird, because all direct calls (to my server) are OK, only inverse calls (through connection points) fail, as AfxConnectionAdvise() warned me when returned 0.

I recently run over the network another distributed application that doesn't use connection points,
but simple callback interfaces instead, and saw that the server could not call the callback method,
obtaining an E_ACCESSDENIED error code. I guess these two incidents have a common cause.

Can please anybody help with a piece of advice?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top