Announcement

Collapse
No announcement yet.

Passing Arrays from PbDll to VbApp

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

  • Michael Mattias
    replied
    I just looked at that #INCLUDE file.

    I thought there would be functions like...

    PBArrayToSafeArray (PbArray(), something)
    and
    SafeArrayToPbArray (pSafeArray, PBArray()

    I need to look at creating some functions like that.

    One of the problems (I think) is going to be allocate/De-allocate... unless we just "make a rule" that you must call 'safearrayDealloc' when done with it, something like that.

    Come to think of it, doesn't...

    LET VariantVar = PBArray()

    create a SafeArray as the contents of variantVar? That would sure simplify this a lot.


    MCM

    Leave a comment:


  • Cliff Nichols
    replied
    MCM
    PowerBASIC's arrays are a PROPRIETARY construct, and they work just terrific within all PowerBASIC-compliled code modules. 'Passing an array' IS simple when you stay within those parameters.
    Yep, and if I had the time I would use all PB (my choice) and just have them call my function, and I handle it internally

    But since I have to pass the info back to VB, its not an option at the moment.

    Edwin
    What kind of array?
    Pointers and MoveMemory() can help as well.
    To keep things simple, I was looking at Long for number, and string for strings (Lets not get started on the whole ASCIIZ vs String vs Fixed String for the moment)

    the VBAPI32.INC is what I am looking at, and from what I can tell is really manipulating pointers to the strings (or longs) in the array. I wish I had time to investigate, but time is an issue

    Sorry if I sound like "Help Help I can't swim", and I am sure someone will point out I am in 3ft of water and yell "ummm dude, you might want to just stand up"

    Leave a comment:


  • Edwin Knoppert
    replied
    What kind of array?
    Pointers and MoveMemory() can help as well.

    Leave a comment:


  • Michael Mattias
    replied
    There are convert PB arrays to/from safe array functions and examples in the VBAPI.INC file included in samples. Also some demo programs using those functions.

    > never thought something as simple as passing an array could be
    > a major bane on my life

    PowerBASIC's arrays are a PROPRIETARY construct, and they work just terrific within all PowerBASIC-compliled code modules. 'Passing an array' IS simple when you stay within those parameters.

    MCM

    Leave a comment:


  • Cliff Nichols
    started a topic Passing Arrays from PbDll to VbApp

    Passing Arrays from PbDll to VbApp

    I am having problems with a GPF with arrays, and I believe it has to do with how VB handles arrays vs how PB handles arrays. So I started looking at "SafeArray" but all the examples I find only involve Passing an array of a numeric type.

    Since I am in a real crunch and the customer (unreasonably) expects the code in a day or 2 (Don't ask...I had no control over the time-frame) I am hoping someone has a simple example of passing arrays (including strings) to and from VB to and from PB.

    I never thought something as simple as passing an array could be a major bane on my life at the moment, and my mind is too busy frying "Bigger Fish" than "Pass an Array"

    Many Thanx to anyone that can show me a simple example
Working...
X