|
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 wrote:
Show quoteHide quote > How can this C# function be converted to VB.NET maybe...> > 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 > Return New IntPtr (IntPtrHiWord.ToInt32() Or IntPtrLoWord.ToInt32()) Or some variant of such... -- Tom Shelton Thanks Tom
but the function returns a IntPtr Show quoteHide quote "Tom Shelton" <tom_shel***@comcast.net> wrote in message news:1167248176.566044.69000@f1g2000cwa.googlegroups.com... > > 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 > > > > maybe... > > Return New IntPtr (IntPtrHiWord.ToInt32() Or IntPtrLoWord.ToInt32()) > > Or some variant of such... > -- > Tom Shelton > Don Juan wrote:
> Thanks Tom And if you look closely, you will see that what i was returning is also> > but the function returns a IntPtr > > a intptr :) -- Tom Shelton Oups!!!
you're right thanks Tom Show quoteHide quote "Tom Shelton" <tom_shel***@comcast.net> wrote in message news:1167268153.569375.150060@n51g2000cwc.googlegroups.com... > > Don Juan wrote: > > Thanks Tom > > > > but the function returns a IntPtr > > > > > > And if you look closely, you will see that what i was returning is also > a intptr :) > > -- > Tom Shelton > |
|||||||||||||||||||||||