I talked to the author of Win32::TieRegistry, Tye (!) McQueen. The problem is that the module is trying to unload the hive when the object is destroyed, at the end of the file, but it has already been unloaded. The solution is, instead of writing

   $ProfileHive->UnLoad;

is to write

   undef $ProfileHive;

He is going to fix the bug and update the documentation. (Yes I know I'm top posting but I think it makes sense in this case.)

- Lyle

Lyle Kopnicky wrote:

Hi,

I am now having trouble unloading a hive. I can load it, and read a value just fine - but when it gets to the UnLoad statement, I get the error "Couldn't unload /Users/./: The parameter is incorrect."

The hive seems to unload by itself when the program quits - but why can I not unload it manually?

Thanks,
Lyle

----------------

use Win32::TieRegistry (Delimiter=>'/');

my $ok = $Registry->AllowLoad(1);

my $ProfileHive = $Registry->{"Users"}->Load($TestProfile, ".");

#$ProfileHive->{"KeyName//$ValueName"} = $NewValue;

my $CurValue = $ProfileHive->{"$KeyName//$ValueName"};
print "value = $CurValue\n";

unless ($ProfileHive->UnLoad) {
   print "Error - unable to unload hive.\n";
}

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to