Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Reading Registry Keys - Bug or Mistake?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-18-2008, 01:56 PM
Junior Member
 
Join Date: Mar 2008
Posts: 41
Default Reading Registry Keys - Bug or Mistake?

I have written these lines:

Sub Globals
'Declare the global variables here.
Dim number, name, files(0) As string, binary(0) As byte
End Sub

Sub App_Start
reg.New1
reg.RootKey(reg.rtLocalMachine)
number = reg.GetValue("Software\OEM", "SysLang") 'Number Of Items is of type REG_DWORD
name = reg.GetValue("Software\Comm", "AutoRun") 'User Name is of type REG_SZ
files() = reg.GetValue("Software\Drivers\BuiltIn", "IClass") 'Recent file is of type REG_MULTI_SZ (multi - string)
binary() = reg.GetValue("Software\AudioCompressionManager\Dri verCache\msacm.msg711","aFormatTagCache") 'BinaryValue is of type REG_BINARY

Msgbox(number, "DWORD")
Msgbox(name, "STRING")
Msgbox(files(), "MULTISTRING")
Msgbox(binary(), "BINARY")

End Sub


It comes given back the error to me of “key not found” on the reading of the DWORD; if I try to exclude the line, same thing for the STRING.
The stranger thing is that I have copied equal par the example of the Handbook; the only variation has been carried out on the path of the variable ones of the registry to read.
I have used one similar sintax in order to read keys on HKCU (rather than HKLM) without problems of risen… it is a bug or mistake something?
Thanks to anyone want to answer to me
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 05:31 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

Are you sure that these keys really exist?
Some tips:
- It is better to use GetString, GetInt and the other Get methods instead of the general GetValue.
- There is no meaning to Msgbox(files()). files() is an array and it can't be implicitly converted to string.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Game and keys pmu5757 Questions & Help Needed 13 06-01-2008 04:56 PM
Trapping Other Keys Louis Questions & Help Needed 3 05-10-2008 08:20 AM
Using hw keys in MS Smartphone TomasNM Questions & Help Needed 4 02-25-2008 04:30 PM
reading and editing registry Dr. Feelgood Questions & Help Needed 3 02-16-2008 08:18 AM
Reading com ports information from the registry Erel Code Samples & Tips 4 11-23-2007 02:09 PM


All times are GMT. The time now is 02:58 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0