Announcement

Collapse
No announcement yet.

Calling PB DLL from 'C'

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Peter Manders
    replied
    > double PassedArray[2][3][5]; (dimensioned opposite as PBArray above)

    Be careful with that, it should be:

    double PassedArray[3][4][6]; (dimensioned opposite as PBArray above)

    Basic subscipts are default 0 to #Elements, in C you have to specify the number of elements, which is one more.


    Peter.


    ------------------
    [email protected]

    Leave a comment:


  • Florent Heyworth
    replied
    That's correct - PB stores array in column-major order
    with (0,0) first, (1,0) second, etc.. whereas C stores
    arrays in row major order: (0,0),(0,1), etc...

    Cheers

    Florent

    ------------------

    Leave a comment:


  • Guest's Avatar
    Guest started a topic Calling PB DLL from 'C'

    Calling PB DLL from 'C'

    Assume I have a PB DLL with the following exported method that
    has one array argument:

    MyMethod(BYVAL PBArrayIn as DWORD) EXPORT

    Then, in my PB code I map the memory to this array as follows:

    DIM PBArray(5, 3, 2) as double AT PBArrayIn

    If I want to call this method from 'C', how should I dimension
    the array that I am passing in? I was told to do the following:

    double PassedArray[2][3][5]; (dimensioned opposite as PBArray above)

    Is this right? Why?

    Thanks for you help on this!
Working...
X