"this variant has no properties"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux