• Welcome to Valhalla Legends Archive.
 

CopyMemory with Visual Basic Express 2005

Started by iNsaNe, March 05, 2007, 10:09 PM

Previous topic - Next topic

iNsaNe

In Visual Basic Express 2005,  declaring a parameter as 'Any' isn't allowed. How could I change this declaration..

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal numbytes As Long)

Spilled

#1
Never used 2005 but try this:

Public Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" (ByRef Destination As Object, ByRef Source As Object, ByVal Length As Short)

l2k-Shadow

Quote from: iNsaNe on March 05, 2007, 10:09 PM
In Visual Basic Express 2005,  declaring a parameter as 'Any' isn't allowed. How could I change this declaration..

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal numbytes As Long)

Public Declare Sub CopyMemoryToInt lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Integer, ByRef Source As String, ByVal numbytes As Integer)

Public Declare Sub CopyMemoryToStr lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As String, ByRef Source As Integer, ByVal numbytes As Integer)
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

iNsaNe

Quote from: l2k-Shadow on March 05, 2007, 11:04 PM

Public Declare Sub CopyMemoryToInt lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Integer, ByRef Source As String, ByVal numbytes As Integer)

Public Declare Sub CopyMemoryToStr lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As String, ByRef Source As Integer, ByVal numbytes As Integer)


I'm kind of noob to this.. what would CopyMemoryToInt and CopyMemoryToStr be used for instead of just using CopyMemory

l2k-Shadow

#4
Quote from: iNsaNe on March 05, 2007, 11:07 PM
Quote from: l2k-Shadow on March 05, 2007, 11:04 PM

Public Declare Sub CopyMemoryToInt lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Integer, ByRef Source As String, ByVal numbytes As Integer)

Public Declare Sub CopyMemoryToStr lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As String, ByRef Source As Integer, ByVal numbytes As Integer)


I'm kind of noob to this.. what would CopyMemoryToInt and CopyMemoryToStr be used for instead of just using CopyMemory

Look at the declarations of both and figure it out.

EDIT: In order to help you understand this, it's because in C++, the function is declared as memcpy(void*, const void*, size_t) so in VB noob terms: take void as something like Any in VB... but since VB.NET doesn't have Any, you have to specify which type of variable you'd like to copy into instead of just "Any variable I want at the time".
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

MyndFyre

QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.