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
Printable View
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
hehe
Sorry if I put you wrong. In my last post to you I included my CopyMemory decalre in case it is different to yours.
If you are using the same as mine, then try this:
thats because you want to tell CopyMemory to start copying memory from the VALUE of the variable "hLock"Code:CopyMemory b(0), ByVal hLock, hSize
What you are doing is telling it to start copying form the LOCATION of the hLock variable...
Cheers
Paul Lewis