S
SamSpade
I'd like to define a wrapped SendMessage. Something like:
function zz (TxtHandle as IntPtr, Msg1 as integer, Msg2 as Integer, Struct
as Structure, StructSize as integer, StructType as ???) as integer
Dim TmpStruc As IntPtr = Marshal.AllocHGlobal(StructSize)
Marshal.StructureToPtr(Struct, TmpStruc, True)
zz=SendMessage(TxtHandle, Msg1, Msg2, TmpStruc)
Struct = CType(Marshal.PtrToStructure(TmpStruc, GetType(StructType)),
StructType)
Marshal.FreeHGlobal(TmpStruc)
end function
I'm not sure about the parameter Struct as Structure. Maybe Object should be
the type?
But I have no idea how to pass the type "StructType" for CType
Think this can be done?
Any idea how?
Thanks in advance
function zz (TxtHandle as IntPtr, Msg1 as integer, Msg2 as Integer, Struct
as Structure, StructSize as integer, StructType as ???) as integer
Dim TmpStruc As IntPtr = Marshal.AllocHGlobal(StructSize)
Marshal.StructureToPtr(Struct, TmpStruc, True)
zz=SendMessage(TxtHandle, Msg1, Msg2, TmpStruc)
Struct = CType(Marshal.PtrToStructure(TmpStruc, GetType(StructType)),
StructType)
Marshal.FreeHGlobal(TmpStruc)
end function
I'm not sure about the parameter Struct as Structure. Maybe Object should be
the type?
But I have no idea how to pass the type "StructType" for CType
Think this can be done?
Any idea how?
Thanks in advance