Results 1 to 5 of 5

Thread: CopyMemory anyone?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    Exclamation

    Heres the deal. I have a variable which contains a memory address of a variably sized (but known size) array. The array is not named or anything.
    Is it possibly to use just the address and get the array into an array of my making, so as i can get the info i require?
    For example...
    i have an memory location X, and a byte array,
    byteArray(0-numOfBytes)

    representation of memory:
    blah|blah|Blah|XXXX|XXXX|XXXX|XXXX|XXXX|Blah|Blah|Blah
    .....................^
    I have this memory location. Each group is a byte. I want to put from the first location to numOfBytes, into a byte array.

    I haven't looked too deeply into CopyMemory, although i have heard it should be able to do it.
    Any ideas?

    BW

    PS Yeah i know this is the same as my last question but i think i have explained it better this time and might have better luck.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    Unhappy Anyone?

    Will i be plagued with this dilemma till the end of time??
    Can anyone help??
    Tune in next week for another exciting episode...


  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    CopyMemory will work, but you need to 'own' the source and the destination.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4
    Guest
    Code:
    CopyMemory ByVal X, byteArray(0), numOfBytes + 1
    you might not need the + 1 part, you declared your array (0 To numOfBytes) (use To instead of -) this means your array has numOfBytes + 1 members, but numOfBytes would suggest the variable represented the number of bytes you have to copy, use the number of bytes you need to copy for the last parameter.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    299

    Cheers Robin

    If only i had read that last night. Thanks heaps, will try that later.

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