(I sent this message also to the clr list, but no reply.)

I've a client/server application.

On client request (for every client) I create an object in its own
application domain on the server. This works fine. But in addition this
object uses classes from another dll which in turn uses managed directx and
when trying to create an object the SECOND time following exception is
thrown. Note: the creation (new) of this object for the first client works!

-----------------------------------------------------
Exception: System.InvalidCastException
Message: Specified cast is not valid.
Source: mscorlib
   at System.Runtime.Remoting.Contexts.Context.DoCallBackFromEE(Int32
targetCtxID, Int32 privateData, Int32 targetDomain
ID)
   at Microsoft.DirectX.DirectPlay.DPlayObjects.Connect(Object sender,
ApplicationDescription applicationDescription, Ad
dress hostAddress, Address deviceInformation, Int32* asyncHandle,
ConnectFlags flags, Object playerContext, Object userC
ontext, Void* lpData, Int32 iDataSize)
........................
-----------------------------------------------------

In addition following error is thrown from time to time when trying to
create this object:

-----------------------------------------------------
Unhandled Exception: System.ArgumentException: Cannot pass a GCHandle across
app domains.
Parameter name: handle
-----------------------------------------------------

Has anybody experiences with such errors? What's the cause of this errors -
workaround?

Thank you for any comments, advices and help!

Regards,

Claus Klammer

Reply via email to