VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Use REAL memory to store strings. (CopyMemory i.e RtlMoveMemory, LocalAlloc, LocalFree API)

Andrew Heinlein (Mouse)  (10 Submissions)   Windows API Call/Explanation   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

Use your machines real memory to store large strings instead of varibles that run down your programs resources.

Returns
fun stuff

Side Effects
because you are allocating real memory, your program may crash in DEBUG mode. it's rare though.

API Declarations
'Put this in a MODULE
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As Any, pSource As Any, ByVal dwLength As Long)
Private Declare Function LocalAlloc Lib "kernel32" (ByVal uFlags As Long, ByVal uBytes As Long) As Long
Private Declare Function LocalFree Lib "kernel32" (ByVal hMem As Long) As Long
Private Const LPTR = (&H0 Or &H40)

Rate Use REAL memory to store strings. (CopyMemory i.e RtlMoveMemory, LocalAlloc, LocalFree API) (3(3 Vote))
Use REAL memory to store strings. (CopyMemory i.e RtlMoveMemory, LocalAlloc, LocalFree API).bas

Use REAL memory to store strings. (CopyMemory i.e RtlMoveMemory, LocalAlloc, LocalFree API) Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters