Click here to Skip to main content
15,881,424 members

Comments by reeselmiller2 (Top 7 by date)

reeselmiller2 31-Dec-14 13:40pm View    
I have actually lost the original source of this code. I copied it along time ago from a tutorial written from Microsoft on how to write a specialized combobox. It had both C# and VB examples. I now believe the VB was converted from the C# with out much thought and the conversion was not actually tested.
reeselmiller2 31-Dec-14 13:21pm View    
Thanks Sergey for your input. The(0) on the end of Decimal.GetBits(18446744073709551583D)(0) I was referring to the low 32 bits because I felt this was the authors intent to narrow from the wider ulong flag for the binary operation. The CInt(Me_flags) simply will not work as intended in VB. I had not considered using System.BitConverter, I'm studying this now. Thank you.
reeselmiller2 30-Dec-14 1:17am View    
Thanks for the reference. This is part of my confusion. The flag is a ulong and can have a value like 18446744073709551583 which converts to a decimal -33, works fine in C#. But in VB if you try "i As Integer = CInt(18446744073709551583UL) you get an overflow error. So you have to use something like Decimal.GetBits(18446744073709551583D)(0) which gives you the low 32bits of the 96 bit Integer. I agree the code is horrible, just trying to understand why it is written this way.
reeselmiller2 30-Dec-14 0:15am View    
Sergey, everyone knows how smart you are and your answers are quite helpful to me. But I felt like you were just in a bad mood. All I wanted was some insight into how the flag value was being used in those lines of code. It seemed like a "magic number" at the time.
reeselmiller2 29-Dec-14 22:54pm View    
Thanks for your solution PIEBALDconsult. This pointed me in the right direction and I understand how that section of code is used now.