Ing. Francesco Carsana wrote:
> Hi,
> 
> I'm working with mono embedding, and I'm trying
> to invoke a c function that accepts two
> parameters:
> 
>     [MethodImpl(MethodImplOptions.InternalCall)]
>     private unsafe extern static void
>       OnConnectHandler(char* _ipAddress, bool _connected);
> 
> This function is invoked inside this method:
> 
>     private static void OnConnect(string _ip, bool _conn);
> 
> The problem is: how can I convert string to char*?
> Is it possible to invoke mono_string_to_utf8?
> 
> Thank You.

Why would you use the signature OnConnectHandler(char* _ipAddress, bool 
_connected); for an internal call in the first place??

Declare it as OnConnectHandler(string, bool) and use MonoString*
for your C++ icall. There you can use mono_string_to_utf8.

Robert


_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to