Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
microsoft.public.dotnet.framework
Re: In VB 'PInvoke cannot return varients' message wrapping C++ li
Raymond
10/17/2008 8:25:00 AM
I am also experiencing the same problem. The DLL is returning a VARIANT. I
have turned on "Option Strict", but the exception still occurs. Can anyone
help?
"Mattias Sjögren" wrote:
>
> >So, basically the function takes 2 IntPtrs, one of the ByReference. So I
> >wrote my VB code like this:
> > Declare Auto Function KAllocCamera Lib "DCSPro4SLR.dll" Alias
> >"KPDCAllocCameraIterator" (ByVal inManagerRef As IntPtr, ByRef outRef As
> >IntPtr)
>
> You forgot to specify a return type, so it defaults to Object which
> marshals as a VARIANT by default.
>
> The solution is to
> 1) Turn on Option Strict so this never happens again
> 2) Specify the correct return type
>
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
>
http://www.msjogren.n...
|
http://www.dotneti...
> Please reply only to the newsgroup.
>
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: In VB 'PInvoke cannot return varients' message wrapping C++ li
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password