[Mono-list] Interop problem: ** ERROR **: Type System.MarshalByRefObject which is passed to unmanaged code must have a StructLayout attribute

Robert Jordan robertj at gmx.net
Wed Feb 28 08:03:41 EST 2007


Frederik,

> Thanks. So it is a "bug" (or at least something that could be improved
> upon) in the MS framework, then. But indeed, the basic problem is this:
> I need to set some callbacks from unmanaged code. The callback should
> contain a stream (or a reference to it) as a parameter.

Since you have to use delegates anyway (only those can be called back
from unmanaged code), you can make the stream a member of the class
that implements the delegate.

Robert



More information about the Mono-list mailing list