Originally posted by colin glenn
View Post
Announcement
Collapse
No announcement yet.
CopyMemory: Memory Access Violation
Collapse
X
-
-
Well, that worked, now to work around another issue, and that is, you can't pass FreeImage_GetFileTypeFromHandle a reference to an Object and expect the object to pass through unscathed, apparently FreeImage is calling the Object's DESTROY mechanism somewhere.
Leave a comment:
-
Use BYVAL on parameters 1 and 2. CopyMemory is simply an encapsulation of the MoveMemory API function (ie. they are exactly the same)
Leave a comment:
-
CopyMemory: Memory Access Violation
The whole error message:Originally posted by PBWin Debugger OutputException: Memory Access Violation
Program tried to read or write an invalid memory addressCode:PROPERTY SET MemoryBuffer(BYVAL dwLength AS DWORD, BYVAL dwData AS DWORD) ' note that depending on what you're passing ' length needs to be ZERO based LOCAL pBuffer, pSource AS BYTE POINTER, pLength, pIndex AS DWORD REDIM memBuffer(dwLength) pSource = dwData pBuffer = VARPTR(memBuffer(0)) pLength = dwLength ' + 1 CopyMemory(pBuffer,pSource,pLength) END PROPERTY
dwLength is the length of the string -1
If I replace the CopyMemory with this:
Code:FOR pIndex = 0 TO dwLength memBuffer(pIndex) = @pSource[pIndex] NEXT pIndex
Anyone out there can Clue/4 me?Tags: None
Leave a comment: