|
|||
|
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! |
|
|||
|
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.
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|