I have run into a interesting bit of code in vb6 that I have been trying to figure out so that I can convert it to vb.net. To what i understand the "Any" keyword refers to the data type used by the API that is used in the code but I cannot figure out the last data type as it errors with the exception "Mismatched type".
The program will load correctly if I replace pDst any with Long and pSrc as Byte and lpString with String the program will load
Declare Sub ArrayDescriptor Lib "kernel32" Alias "RtlMoveMemory"(pDst As Any, pSrc() As Any, ByVal ByteLen As Long)
Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (lpString As Any) As Long
Dim ARD As Integer
ArrayDescriptor(ARD, FDATA, 4)
If ARD = 0 Then MsgBox("File isn't loaded yet!", MsgBoxStyle.Critical, "Error") : Exit Sub
DISASM.BaseAddress = VIRTUALBASEADR + VIRTUALADR - POINTERTORAW
Dim Forward As Byte
Dim CNT As Integer
CNT = POINTERTORAW
Dim u As Integer
Dim DATAS() As String
ReDim DATAS(SIZEOFRAW)
Dim TC2 As Integer
Dim TC As Integer
Label1.Text = "Disassemble..."
System.Windows.Forms.Application.DoEvents()
TC = GetTickCount
Do
DATAS(u) = DISASM.DisAssemble(FDATA, CNT, Forward, 1, 0) & vbCrLf
u = u + 1
CNT = CNT + Forward
Loop While SIZEOFRAW + POINTERTORAW > CNT
TC2 = GetTickCount
Label1.Text = "Disassembled for " & TC2 - TC & " msec"
System.Windows.Forms.Application.DoEvents()
ReDim Preserve DATAS(u - 1)
rt1.Text = Join(DATAS, "")
Erase DATAS
this part of the code is what seems to be giving me problems when trying to figure out what data type to replace "Any" with. When I change pSrc to Byte and leave pDst to Any the program loads without a hitch but its that last data type that i need and is the problem to my question.
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
'Is anyone able to tell me what data types are used in place of "Any" for the array descriptor sub and for sub copyMemory?<
Thank you in advance and I apologize for the lengthy question!