Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Marshaling Interfaces to a Windows NT Service

AbsBahadoriAbsBahadori Member Posts: 1
Hello,
I've written a EXE COM Server (Not a Windows NT Service) using VC++ 6.0 ATL Wizard. I've used CoMarshalInterface API function to marshal interfaces between COM clients and COM Server. It's functioning well. Now I've decided to change my COM Server type to Windows NT Service. But now the marshaling in this situation doesn't work. Here is the code:

/*client side code

IStream* pStream = NULL;
CreateStreamOnHGlobal(0 , TRUE , &pStream);
CoMarshalInterface(pStream , IID_IMyInterface , pMyInterface ,
MSHCTX_DIFFERENTMACHINE , NULL ,
MSHFLAGS_NORMAL);
pServer->SendObject(pStream);


/*server side code
CServerService::SendObject(IUnknow* pObject)
{
IStream* pStream = NULL;
HRESULT hr = pObject->QueryInterface(&pStream); //Here I
get E_ACCESSDENIED Error

IMyInterface* pMyInterface = NULL;

CoUnmarshalInterface(pStream , IID_IMyInterface , (void**)
&pMyInterface);
}

Thank you in advance.
Sign In or Register to comment.