Results 1 to 2 of 2

Thread: CopyMemory crashes VB

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 1999
    Location
    Ilirska Bistrica, Slovenia
    Posts
    242
    Hello!

    Does anyone know why CopyMemory function crashes VB?

    Here's the code I use:
    Code:
        hLock = LockResource(hLoad)
        hSize = SizeofResource(hInst, hFind)
        
        ReDim b(0 To lsize) As Byte
        CopyMemory b(0), hLock, hSize
        
        FreeLibrary hInst
    Zvonko Bostjancic
    Ilirska Bistrica, Slovenia
    [email protected]
    Using VS6 Professional with SP3
    Programming mostly in VB and I've started to learn VC++ & MFC

  2. #2
    Lively Member
    Join Date
    Apr 2000
    Location
    Hell
    Posts
    89
    Because hLock is only 4 bytes in size.
    - Steve

    Real programmers use COPY CON PROGRAM.EXE

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