Click here to Skip to main content
15,897,122 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Usercontrols on Panes Pin
Member 85737725-May-04 8:56
Member 85737725-May-04 8:56 
GeneralRe: Usercontrols on Panes Pin
Dave Kreskowiak25-May-04 11:14
mveDave Kreskowiak25-May-04 11:14 
GeneralRe: Usercontrols on Panes Pin
emari25-May-04 22:02
emari25-May-04 22:02 
GeneralRe: Usercontrols on Panes Pin
Member 85737725-May-04 9:24
Member 85737725-May-04 9:24 
Generalkernel32.dll Call Problems Pin
Pugman81224-May-04 23:03
Pugman81224-May-04 23:03 
GeneralRe: kernel32.dll Call Problems Pin
Dave Kreskowiak25-May-04 0:33
mveDave Kreskowiak25-May-04 0:33 
GeneralRe: kernel32.dll Call Problems Pin
Pugman81225-May-04 9:17
Pugman81225-May-04 9:17 
GeneralRe: kernel32.dll Call Problems Pin
Dave Kreskowiak25-May-04 11:57
mveDave Kreskowiak25-May-04 11:57 
First, why are you even using CopyMemory? From what I see here you don't need it.

OK. You've got two problems. Your code:
Public Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByVal Destination As Int32, ByRef Source As Object, ByVal Length As Int32)
.
.
.
call CopyMemory(CInt(ByteArray(12)), CInt(ByteArray(0)), CInt(OrigLen))
.
.
.

What your doing here is nasty to say the least. CopyMemory takes 3 parameters, a Destination address, a Source address, and a Length to copy, in bytes. What you've done is tell VB to marshal the Destination address as an Int32 and the Source as a reference to an Object. What your doing is converting ByteArray(12) and ByteArray(0) to Integers, then by the definition you setup in the Declare statement, you're passing the VALUE of ByteArray(12) to CopyMemory, NOT the address! Next, your passing a reference (or address) as the second argument, but your passing an Object reference to another byte converted to an Integer. CopyMemory expects an address for the first and second arguments, you got one right.

You might want to take a look at this[^] article before trying to use CopyMemory.


RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: kernel32.dll Call Problems Pin
Pugman81225-May-04 12:34
Pugman81225-May-04 12:34 
GeneralOpening large tiff files Pin
NaserAbiat24-May-04 19:22
NaserAbiat24-May-04 19:22 
GeneralRe: Opening large tiff files Pin
Dave Kreskowiak25-May-04 0:30
mveDave Kreskowiak25-May-04 0:30 
GeneralRe: Font color,Type, Columns... Pin
Dave Kreskowiak24-May-04 16:49
mveDave Kreskowiak24-May-04 16:49 
GeneralRe: Font color,Type, Columns... Pin
Dave Kreskowiak25-May-04 0:28
mveDave Kreskowiak25-May-04 0:28 
GeneralRe: Font color,Type, Columns... Pin
rubdub25-May-04 20:18
rubdub25-May-04 20:18 
GeneralSetting Enviroment Variables Pin
waffleman24-May-04 8:58
waffleman24-May-04 8:58 
GeneralRe: Setting Enviroment Variables Pin
Dave Kreskowiak24-May-04 9:22
mveDave Kreskowiak24-May-04 9:22 
GeneralMultithreading Help Pin
800XL24-May-04 5:59
800XL24-May-04 5:59 
GeneralRe: Multithreading Help Pin
Dave Kreskowiak24-May-04 7:11
mveDave Kreskowiak24-May-04 7:11 
GeneralRe: Multithreading Help Pin
800XL24-May-04 23:32
800XL24-May-04 23:32 
GeneralRe: Multithreading Help Pin
Dave Kreskowiak25-May-04 0:24
mveDave Kreskowiak25-May-04 0:24 
GeneralRe: Multithreading Help Pin
800XL25-May-04 0:57
800XL25-May-04 0:57 
GeneralRe: Multithreading Help Pin
800XL26-May-04 1:19
800XL26-May-04 1:19 
QuestionHow can I........? Pin
Night_Soul24-May-04 2:37
Night_Soul24-May-04 2:37 
AnswerRe: How can I........? Pin
Dave Kreskowiak24-May-04 3:22
mveDave Kreskowiak24-May-04 3:22 
GeneralRe: How can I........? Pin
Night_Soul24-May-04 4:45
Night_Soul24-May-04 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.