Results 1 to 7 of 7

Thread: Difficult question - Experts Help Required

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    Exclamation

    I have a structure being passed to by a callback.
    One of the parts in the structure is a long called lpData, which is the address to the data in memory (i assume).
    Now in the C equivalent code (which i'm trying to imitate), there is a loop in which loops though the data and gets various bits of info out of it.
    Can anyone tell me, knowing (assuming) that the lpData is the pointer to the data in memory, how do i get the info out of memory using that pointer.
    Confused? I am and i'm the one trying to do it. I have nearly finished a personal goal and this is what is blocking me at the moment.
    Cheers in advance
    But_Why

  2. #2
    Guest

    Question A bit confused about this

    Ok directly accessing memory is a time honoured technique in C and assembly


    But


    This isn't really a technique in VB as such

    Hmmm....having said that try something like
    Add a textbox to the form and set

    textbox1 = lpData

    Ok at this stage just want a report back on what shows up in the textbox. Is this memory allocation or what?????

    Probably doesn't help you at the moment, but will maybe indicate to you, me, or some one else how to proceed.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    Cool Thanks for that Jethro

    I was thinking noone would be able to help.
    I will try that tonight and let you know. If it helps then GREAT.

    BTW i have seen an API around, i think it was
    CopyStructFromMemory, or something to that effect.
    Anyone know of it, or something that works similarly.

    I'm pretty sure i have seen it before (of course only when i wasn't looking for it), but can't for the life of me find it again.

    Cheers
    BW

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    Unhappy memory access

    Anyone know about GlobalAlloc and GlobalLock
    Also CopyStructFromPtr is what i was trying to get at before.
    Cheers

  5. #5
    Lively Member
    Join Date
    Jun 2000
    Location
    Belgium
    Posts
    77
    I think you can use the CopyMemory API
    Take a look at the address for how to use ithttp://www.vbapi.com/ref/c/copymemory.html
    KWell

  6. #6
    Lively Member Kersey's Avatar
    Join Date
    Jun 1999
    Location
    The Netherlands
    Posts
    101

    just wondering

    what structure is being returned by the callback ?

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    Cool The struct

    Kersey: The callback is returning a buffer from the wavein device. I'm trying to extract the data from the buffer.

    Anyone else done this in VB? I have found very little on it on the web. Very little. In fact, pretty much nothing in VB. Not a lot in C either hehehehe.

    KWell: I have seen a copymemory thing around, i just couldn't remember what it was called. Thanks for the link, i'll look into it, and see if thats what i'm after.

    Cheers guys, look forward to any other replies, and will try Kwells idea.
    BW

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width