Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Uses the CopyMemory API function to READ and WRITE...
Author:
766e4@mail.com
E-mail:
Click to e-mail author
Submitted:
1/5/2001
Version:
VB5
Compatibility:
VB5, VB6
Category:
Windows API
Views:
9554
Uses the CopyMemory API function to READ and WRITE a block of memory byte by byte from one memory address to another.
Declarations:
Private Declare Sub CopyMemory Lib "kernel32" Alias _ "RTlMoveMemory" (lpDest As Any, lpSource AS Any, _ ByVal cbCopy As Long)
Code:
Dim varlng As Long Dim Y As Integer Dim DestArray(1 To 4) As Byte Public Sub ReadMem() ' set varlng varlng = &H12345678 'use CopyMemory API to copy varlng to DestArray byte by byte CopyMemory DestArray(1),ByVal varlng, 4 'The argument "4" represents the number of bytes to copy. End Sub Public Sub WriteMem() ' set varlng varlng = &H12345678 'use CopyMemory API to copy varlng to DestArray byte by byte CopyMemory ByVal varlng,DestArray(1), 4 'The argument "4" represents the number of bytes to copy. End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement