[Mono-dev] string marshalling conversion 34 not implemented

Jonathan Chambers joncham at gmail.com
Sat Apr 5 15:42:54 EDT 2008


Hello Josh,
     You didn't post the signature of your pinvoke function, but it looks
like you are trying to marshal a string using UnmanagedType.VBByRefStr. This
does seem to be a limitation in mono (and not fixed in svn head), however
the docs seem to indicate that this should only be used for VB
compatibility. If you are changing/return the string in unmanaged, you need
to use a StringBuilder. If you are only passing a string in, you can just
pass a string (and specify the native string type).

See this great page on the wiki for more info:

http://www.mono-project.com/Interop_with_Native_Libraries

Thanks,
Jonathan

2008/4/4 Josh <TwoOneSix at thatclothingco.com>:

> Mono is throwing me the error "string marshalling conversion 34 not
> implemented" when I'm attempting to call a function to libvlc.dll from my
> code. The other calls to the DLL work fine, but the AddTarget Function
> causes the error. I'm getting the same results on both Windows and Linux
> versions.
>
> [AddTarget Function]
> ===============================
> public Err AddTarget(string Target)
> {
>     if ((m_iVlcHandle == -1)) {
>         m_strLastErr = "LibVlc is not initialzed";
>         return Err.NoInit;
>     }
>     Err enmErr = Err.Success;
>     try {
>         enmErr = VLC_AddTarget(m_iVlcHandle, Target, null, 0,
> (int)Mode.Append, (int)Pos.Close);
>     }
>     catch (Exception ex) {
>         m_strLastErr = ex.Message;
>         return Err.Execption;
>     }
>     if (((int)enmErr < 0)) {
>         m_strLastErr = VLC_Err((int)enmErr);
>         return enmErr;
>     }
>     // OK
>     return Err.Success;
> }
> ===============================
>
> [Mono Details - Windows]
> ===============================
> Mono JIT compiler version 1.9 (tarball)
> Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
>         TLS:           normal
>         GC:            Included Boehm (with typed GC)
>         SIGSEGV:       normal
>         Notification:  Thread + polling
>         Architecture:  x86
>         Disabled:      none
> ===============================
>
> [Mono Details - Linux]
> ===============================
> Mono JIT compiler version 1.9 (tarball)
> Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
>         TLS:           __thread
>         GC:            Included Boehm (with typed GC)
>         SIGSEGV:       normal
>         Notifications: epoll
>         Architecture:  x86
>         Disabled:      none
> ===============================
>
> Any ideas? Might this be fixed in HEAD? I'm also up to using a different
> media player that is "known to work" in mono.
>
> Josh
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080405/daf1af90/attachment-0001.html 


More information about the Mono-devel-list mailing list