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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in Implementation of Callbacks in ATL

Status
Not open for further replies.

Dennis7

Programmer
Dec 10, 2001
6
0
0
IN
I am trying to implement the callbacks in the ATL.I am facing very peculiar problem in implementing callbacks.I have a Server(ATL EXE,this will be on remote machine) and the clients(ATL DLL).I include the refernce of the client dll in Standard EXE(VB) and test my server from there.The client makes the object of the server and pass its
IUnknown interface through the server member function.Server is using CComDynamicUnkArray for storing the
IUnknown of the various cookies.Now to notify the client of any event,i call QueryInterface on the IUnknown of the client to get the callback interface.But at this time it gives an error :-No such Interface supported.

I have created the proxy-stud for both i.e ATL Exe(Server) and ATL DLL
(Client).The callback interface(ICallBackItf) has an attribute
oleautomation....Please suggest me what is happening..Is there any probelm
with universal type marshaller..
m_pArrayCallBk is a data member of CMathExe of CComDynamicUnkArray.....

HRESULT CMathExe::FireEvent_AdditionDone(long lResult)
{
AfxMessageBox("FireEvent",MB_OK);
HRESULT h_Result;
for(IUnknown** pp =m_ArrayCallBk.begin();pp < m_ArrayCallBk.end();++pp)
{
AfxMessageBox(&quot;For Loop&quot;,MB_OK);
if(*pp)
{
ICallBackItf *pCallbackPtr=NULL;
h_Result=(*pp)->QueryInterface(&pCallbackPtr);//Fials here
if(FAILED(h_Result))
{
AfxMessageBox(&quot;Failed&quot;,MB_OK);
DISPLAYERROR(h_Result);
}
else
{
AfxMessageBox(&quot; Succedded&quot;,MB_OK);
h_Result=pCallbackPtr->OnTaskFinished(lResult);
}
}
}
return S_OK;
}

Waiting eagerly for reply....Pls suggest any solution for this....
Sir,i can send u the code of client and server at ur personal account if u
want...

With Regard's
Dinesh-Ahuja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top