Loading ...
Sorry, an error occurred while loading the content.

how to pass an array pointer to a dll function

Expand Messages
  • gaorozcoo
    Hi everybody, I need to call a function in a dll that receives a pointer to an array. It is something like this: long ReadBuffer (double * dataBuffer). This
    Message 1 of 2 , Nov 30, 2009
    • 0 Attachment
      Hi everybody,

      I need to call a function in a dll that receives a pointer to an array. It is something like this: long ReadBuffer (double * dataBuffer). This function writes values in dataBuffer.

      The dataBuffer length is 200. Does somebody know how to do that?

      Thank for your help
    • Stefan Pendl
      ... Do you want to fill the array or receive the individual items? There is no direct way to do this, but there are two workarounds, one using API functions to
      Message 2 of 2 , Dec 1, 2009
      • 0 Attachment
        >
        > Hi everybody,
        >
        > I need to call a function in a dll that receives a pointer to
        > an array. It is something like this: long ReadBuffer
        > (double * dataBuffer). This function writes values in dataBuffer.
        >
        > The dataBuffer length is 200. Does somebody know how to do that?
        >
        > Thank for your help
        >

        Do you want to fill the array or receive the individual items?

        There is no direct way to do this, but there are two workarounds, one using API functions to manage the memory and one to use native
        commands.
        The API way is what the teacher tells us to use, but the native way is more user friendly.

        Generally, you would use a string of the size of the array, but without the API function it is hard to know what to choose.
        There might be other possibilities too.

        Can you post a working example, which only misses the array code?

        ---
        Stefan Pendl

        Liberty BASIC Assist 4.03 ........ http://www.libertybasic.com/assist.html
        Liberty BASIC 4.04 public beta ... http://www.libertybasic.com/lb404b3setup.exe

        Windows Vista Home Premium 32-bit SP2
        AMD Turion X2 RM-70 2GHz, 4GB RAM
      Your message has been successfully submitted and would be delivered to recipients shortly.