Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / March 2008

Tip: Looking for answers? Try searching our database.

Visual Basic .NET 2008 registry GetValue exception - what wrong?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andre Klimov - 31 Mar 2008 08:40 GMT
Hi!

Situation:

simple code read registry value (OpenSubKey -> GetValue, as usual).
Requested value exists in registry and has type DWORD, read into the
variable UInt32, access rights granted.

When value's data is in interval &H0 - &H7FFFFFFF - it's works fine. When
value's data has "sign bit rised" (&HF0000000 - &HFFFFFFFF) - arithmetic
operation exception occurs (overflow).

Question is: is it a bug in Microsoft.VisualBasic.dll or just stupid error
in registry usage?

WBR, Andre Klimov
Aladdin Knowledge Systems
Israel

PS
VS2008 Team Suite v9.0.21022.8 RTM (MSDN downloaded), standard installation

PPS
Sorry for simple question - I'm beginner and start use VB.NET only 3 days
before...
Bill McCarthy - 31 Mar 2008 09:50 GMT
It's actually a problem in the .NET framework  When the registry key type is
REG_DWORD they use an Int32
in RegistryKey.InternalGetValue

So you need to use an Int32 (aka Integer), not  an unsigned one.

> Hi!
>
[quoted text clipped - 22 lines]
> Sorry for simple question - I'm beginner and start use VB.NET only 3 days
> before...
Andre Klimov - 31 Mar 2008 13:23 GMT
Thank you very much!

WBR,

> It's actually a problem in the .NET framework  When the registry key type is
> REG_DWORD they use an Int32
> in RegistryKey.InternalGetValue
>
> So you need to use an Int32 (aka Integer), not  an unsigned one.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.