[Mono-list] Custom Marshalling

2004-10-28 Thread Neale.Ferguson
I've implemented some custom marshalling for an external call so that the parameters being sent gets massaged as required by the external routine. In addition, it is supposed to massage data after the call. However, while it will do so on the way out, it's not being driven the other way. I

Re: [Mono-list] Custom Marshalling

2004-10-28 Thread Marcus
I'm a little confused by your description. I am not trying to be difficult, but you use the pronoun it in many places where the antecedent is unclear. Also, the phrase on its way out is not clear. Perhaps if you demonstrated the problem using a P/Invoke method with fewer parameters and

RE: [Mono-list] Custom Marshalling

2004-10-28 Thread Neale.Ferguson
I'll attempt to think before I type this time :-) I have a a C routine I wish to call that takes the following parameters: typedef struct XXXCB { short a; char b[2]; }; void scumbag(XXXCB *cb, char *v); for our purposes v is an arbitrarily long string of bytes in the range 0x00-0x7f.

RE: [Mono-list] Custom Marshalling

2004-10-28 Thread Jonathan Pryor
You're making this far too difficult on yourself. See below. On Thu, 2004-10-28 at 19:57, [EMAIL PROTECTED] wrote: I'll attempt to think before I type this time :-) I have a a C routine I wish to call that takes the following parameters: typedef struct XXXCB { short a; char

Re: [Mono-list] Custom marshalling

2004-08-05 Thread Marcus
Unfortunately, UnmanagedMarshal.DefineCustom is a Mono-only class and not part of .NET. The normal .NET mechanism is to create a custom attribute using CustomAttributeBuilder to obtain an instance of MarshalAsAttribute with the custom marshaler specified. That does not seem to work under Mono.

[Mono-list] Custom marshalling

2004-07-25 Thread Alan Jenkins
As far as I can tell, Mono supports custom marshalling outside of function calls (like PInvoke), - ie using Marshal.StructToPtr and PtrToStruct, but you have to use UnmanagedMarshal.DefineCustom, which would involve reflection of some sort - possibly creating your class with custom marshalled