void **ppImageBuffer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Sm9obg==?=

    #1

    void **ppImageBuffer

    Hi Experts,

    I am trying to use a C++ dll from my VB .NET program, but I don't know how
    to handle things like void **ppImageBuffer . Please see the following and help
    me out.

    Thanks.

    //C++ dll
    int WINAPI CameraSetValue( short nParameter, void *pValue);

    int WINAPI CameraGetImages (int nNumImages, void **ppImageBuffer );

    'VB .NET
    <DllImport("Cam era.dll")>
    Public shared Function SpotSetValue(By Val nParameter As Short,
    ????What_to_put _here????) As Integer
    End Function

    <DllImport("Cam era.dll")>
    Public shared Function CameraGetImages (int nNumImages,
    ????What_to_put _here????) As Integer
    End Function

  • Mattias Sjögren

    #2
    Re: void **ppImageBuffer

    >//C++ dll
    >int WINAPI CameraSetValue( short nParameter, void *pValue);
    >
    >int WINAPI CameraGetImages (int nNumImages, void **ppImageBuffer );
    >
    >'VB .NET
    ><DllImport("Ca mera.dll")>
    >Public shared Function SpotSetValue(By Val nParameter As Short,
    >????What_to_pu t_here????) As Integer
    >End Function
    >
    ><DllImport("Ca mera.dll")>
    >Public shared Function CameraGetImages (int nNumImages,
    >????What_to_pu t_here????) As Integer
    >End Function
    In the most general form

    Public shared Function SpotSetValue(By Val nParameter As Short,
    ByVal pValue As IntPtr) As Integer

    and

    Public shared Function CameraGetImages (int nNumImages, ByRef
    ppImageBuffer As IntPtr) As Integer

    But if you acually know what tyoe of data you're going to pass in and
    get back, there's a good chance you can save some work by using a more
    specific parameter type.


    Mattias

    --
    Mattias Sjögren [C# MVP] mattias @ mvps.org
    http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
    Please reply only to the newsgroup.

    Comment

    Working...