Page 1 of 1 1
Topic Options
#23386 - 2002-06-17 09:35 PM Kix bug writing to the registry
Armin Linder Offline
Fresh Scripter

Registered: 2002-06-17
Posts: 22
The following line of Kix code does not work on three independent systems here (2 Windows 2000 SP2, 1 Windows NT4 SP6)

? writevalue("HKEY_CURRENT_USER\Software\Linder\TestKey","TestValue","xxxxx","REG_SZ")

Simple enough, isn't it? I get an error code of 2 (file not found). To eliminate the possibility of typos and access privileges problems I set the same key using the following reg file:

REGEDIT4

[HKEY_CURRENT_USER\Software\Linder\TestKey]
"TestValue"="xxxxx"

This succeeds. And now I can use the kix code as well, which is successful, as long as I do not attempt to create another subkey. I may, however, add as many values to an existing key as I wish.

Is anyone else able to confirm this problem?

Thanks,

Armin Linder

Top
#23387 - 2002-06-17 09:43 PM Re: Kix bug writing to the registry
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Did you verify that the key "HKEY_CURRENT_USER\Software\Linder\TestKey" existed before you attempted to WriteValue using this key?

My guess is that the key itself did not exist and that resulted in the error 2 File not found.

Use KeyExist() to see if you are processing a value key.

Use AddKey to create the TestKey before before writing to it.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#23388 - 2002-06-17 09:44 PM Re: Kix bug writing to the registry
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
linder...
it's not windows key.
so when you try to set the value, you should have written the subkey before writing it.

this is just for making sure that you have done that. as kix does not automatically add the subkeys when writing a value.

cheers,
_________________________
!

download KiXnet

Top
#23389 - 2002-06-17 10:37 PM Re: Kix bug writing to the registry
Armin Linder Offline
Fresh Scripter

Registered: 2002-06-17
Posts: 22
100% correct, guys. Need to use addkey first.

Thanks a lot,

Armin Linder

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1343 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.222 seconds in which 0.162 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org