Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-29-2008, 03:13 PM
Junior Member
 
Join Date: Feb 2008
Posts: 7
Default Reading from Registry crashes XP


Oh boy, do I feel silly or what?

Right after posting my plea for help, I figured it out.

Now I'm wondering if this is going to cause problems for people who will run my projector on a computer without being administrators (and therefore possibly not having write access to the registry)?



Code:
rv = new RegValue;
rv.name = "test";
rv.data = "This is a test";
rv.type = 1;//REG_SZ
r = RegKey.create("HKCU\\Software\\Windows\\System\\AOA");
r.write(rv);


rk = new RegKey("HKCU\\Software\\Windows\\System\\AOA\\");
values = rk.getValues();

for (i = 0; i < values.length; i++){
	//if (values[i].name == "INSTALLID"){
		installID = String(values[i].data);
		//if (installID.length == 4){
		  //return installID;
		  Dialogs.msgBox(installID);
		//}
	//}
}

------ old / initial post -------

Following the examples from the SWFKit documentation, I can get SWFKit to write to the registry without any problems. After running the code (see below), I can see the registry values in the correct place.


However, I cannot read any values from the registry. With some of the examples I've modified and tried out, I ended up crashing Windows XP (Windows debugger popped up, the projector terminated, etc.).


Here's the code I currently have. The problem is that trying to read back the value I added to the registry will display [object RegValue]. I even tested it with rgv.toString(), but that didn't make any difference.

(Yes, I did try this with two different scripts, too, calling them at different times, because I thought that perhaps the registry needs a few seconds to update itself before it can display the values -- didn't make any difference.)



Code:
rv = new RegValue;
rv.name = "test";
rv.data = "This is a test";
rv.type = 1;//REG_SZ
r = RegKey.create("HKCU\\Software\\Windows\\System\\AOA");
r.write(rv);


rk = new RegKey("HKCU\\Software\\Windows\\System\\AOA");
rgv = rk.getValue("test");
Dialogs.msgBox(rgv);


Does anybody have a working solution?

If that doesn't work, does anybody have an ".ini file solution" that could be used to keep track of some projector settings (instead of using the registry)?

Any help would be much appreciated!



Reply With Quote
  #2 (permalink)  
Old 03-05-2008, 08:50 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Reading from Registry crashes XP

You can use the "readProfile" and "writeProfile" methods to save values in registry, which are much easier than the "RegKey" object. If you want to use the "RegKey" object, please write the values under the key of your program so that they can be accessed by even using a guest account.
Reply With Quote
  #3 (permalink)  
Old 03-05-2008, 01:35 PM
Junior Member
 
Join Date: Feb 2008
Posts: 7
Default Re: Reading from Registry crashes XP

Thank you very much!

Good stuff to know. I greatly appreciate your help.
Reply With Quote
Reply

Was this information helpful?    Yes No



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

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



All times are GMT. The time now is 05:03 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.