0

I want to allocate a large array of data "three mega bytes" and I don't know how to do this in VB after allocating this array I want to pass a pointer to it to C++ DLL what is the appropriate pointer knowing that it is not an array of string can I use LPSTR, can anyone help me

1
Contributor
1
Reply
2
Views
10 Years
Discussion Span
Last Post by bibo1978
0

I want to allocate a large array of data "three mega bytes" and I don't know how to do this in VB after allocating this array I want to pass a pointer to it to C++ DLL what is the appropriate pointer knowing that it is not an array of string can I use LPSTR, can anyone help me

I use this code but it crashes
Dim BufferSize As Long
Dim BufferPtr As Long
Dim MemoryPtr As Long

BufferSize = FileLen(CommonDialog1.FileName)
MemoryPtr = GlobalAlloc(GMEM_FIXED, BufferSize)
If (MemoryPtr) Then
CopyMemory MemoryPtr, FileNum, BufferSize
end if

Public Declare Sub CopyMemory Lib "kernel32" _
Alias "RtlMoveMemory" _
(hpvDest As Any, _
hpvSource As Any, _
ByVal cbCopy As Long)

can anybody help

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.