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

Try to marshal a interface pointer to DCOM server (E_OUTOFMEMORY) 1

Status
Not open for further replies.

FZschech

Programmer
Jun 25, 2001
1
CH

Try to marshal a interface pointer to DCOM server (E_OUTOFMEMORY)
__________________________________________________________________

We are working on a server using DCOM (exe - application).
This server is running on Windows2000 Professional Server Version.
Our clients (exe - application) are running on the old Windows95 operating system.

Within the startup of all clients, they connect to the DCOM server.

////////// - code - //////////

MULTI_QI qi;
qi.pIID = &__uuidof (ISMDcomServer);
qi.pItf = 0;

HRESULT res = CoCreateInstanceEx (CLSID_SMDcomServer,
0,
CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,
& serverInfo,
1,
& qi);
////////// - code - //////////

To get the interface (ISMDcomServer) of the DCOM server always possible.
After that, the client try to send his own interface pointer (ICallback) to the running
DCOM server. The server interface function (RegisterCallBack) is called. But sometimes
this call is blocking or returns with error code (0x8007000E) E_OUTOFMEMORY.
Terrible situation....

////////// - code - //////////
dcomServer = static_cast <ISMDcomServer *> (qi.pItf);

ICallback * callBack = new ICallback();

HRESULT res = dcomServer->RegisterCallBack (callBack);

switch (HRESULT_CODE (res))
{
case E_OUTOFMEMORY:
{
// RegisterCallBack: failed....
// error code (0x8007000E)
}
break;
}
////////// - code - //////////

Why is it not possible to send a custom interface pointer to the server. Under WindowsNT
this transactions always work fine.
We have the DCOM version 1.3 on Windows95 installed. All security settings are lowest.

Please, could someone help us with this problem?
Thanks a lot! :eek:)

Regards
Frank Zschech

e-Mail:
Frank.Zschech@siemens.ch
FZschech@hotmail.com
 
The servers could be local, inproc or remote, not a some combination between them. John Fill
1c.bmp


ivfmd@mail.md
 
I am assuming that you client side is a a COM object or has access to one, which supports the ICallback interface.

If that is so then I think the problem might be with the following line of code :-

ICallback * callBack = new ICallback();

I don't think you can instantiate your ICallback interface pointer like this. I would use one of the following 2 methods.

If you are executing this within the object implementing ICallback then.

ICallback *callBack = static_cast <ICallback*>this;

or if you are executing outside of the object supporting ICallback but have access to its IUnknown (pUnk) interface then, call QueryInterface to retrieve the interface from the object.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top