|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
C# function be converted to VB.NETstatic IntPtr MakeLParam(int LoWord, int HiWord) { return (HiWord << 16) | (LoWord & 0xffff); } I'm trying the following but is causing an error : (Operator Or is not defined for types System.IntPtr and System.IntPtr) Shared Function MakeLParam(ByVal LoWord As Integer, ByVal HiWord As Integer) As IntPtr Dim IntPtrHiWord As New IntPtr(HiWord << 16) Dim IntPtrLoWord As New IntPtr(LoWord And &HFFFF) Return IntPtrHiWord Or IntPtrLoWord End Function "Don Juan" <carlos.rodrig***@multicim.com> ha scritto nel messaggio Make operations on the integer params as in the c# code, and *then* convert news:O8ZwRYeKHHA.3488@TK2MSFTNGP02.phx.gbl... > > static IntPtr MakeLParam(int LoWord, int HiWord) > { > return (HiWord << 16) | (LoWord & 0xffff); > } > > I'm trying the following but is causing an error : (Operator Or is not > defined for types System.IntPtr and System.IntPtr) it to IntPtr. Actually, the direct translation to VB (via Instant VB) works just fine:
Shared Function MakeLParam(ByVal LoWord As Integer, ByVal HiWord As Integer) As IntPtr Return (HiWord << 16) Or (LoWord And &HFFFF) End Function -- Show quoteHide quoteDavid Anton www.tangiblesoftwaresolutions.com Instant C#: VB to C# converter Instant VB: C# to VB converter Instant C++: C#/VB to C++ converter Instant Python: VB to Python converter "Don Juan" wrote: > How can this C# function be converted to VB.NET > > static IntPtr MakeLParam(int LoWord, int HiWord) > { > return (HiWord << 16) | (LoWord & 0xffff); > } > > I'm trying the following but is causing an error : (Operator Or is not > defined for types System.IntPtr and System.IntPtr) > > > Shared Function MakeLParam(ByVal LoWord As Integer, ByVal HiWord As Integer) > As IntPtr > > Dim IntPtrHiWord As New IntPtr(HiWord << 16) > Dim IntPtrLoWord As New IntPtr(LoWord And &HFFFF) > > Return IntPtrHiWord Or IntPtrLoWord > > End Function > > > > > |
|||||||||||||||||||||||