"this variant has no properties"?

Thomas Anderson <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <[email protected]>
<?php
$wscript = new COM('WScript.Shell');
while (true) {
    $random = $wscript->RegRead('HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography\\RNG\\Seed');
    var_dump($random->value);
    sleep(1);
    echo "\r\n";
}
?>

That gives me a "this variant has no properties" error.  My question
is...  how on earth does it not have any properties?  As the following
VBscript is testament to, it clearly does have properties:

function bin2hex(values)
	dim result
	for each value in values
		temp2 = hex(value)
		select case len(temp2)
			case 0: result = result & "00"
			case 1: result = result & "0" & temp2
			case 2: result = result & temp2
		end select
	next
	bin2hex3 = result
end function

Set WshShell = createObject("WScript.Shell")

temp = WshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\RNG\Seed")
MsgBox(bin2hex(temp))

Doing vartype on temp reveals that it's an array of variants (VT_ARRAY
| VT_VARIANT).  Even variant_get_type agrees.  But how do access the
elements of htat variant array?  Can I?

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.