From:             oespeter at gravityshock dot biz
Operating system: Win2k; Win2003 Server
PHP version:      5.2.5
PHP Bug Type:     COM related
Bug description:  Problem with Variant/Parameters

Description:
------------
Hi, I have problems fetching data from an special database over a
com-based sdk. With VisualBasic it's not a problem, but the same code
doesn't work with php. Some folks (lists/forums) said it may be an bug in
the COM-Extension of PHP.
The error occurs with a COM based SDK (called PI-SDK from OsiSoft Inc.). I
can work via COM with all functions that need no parameters. But most of
the functions that need params didn't work with php. With VisualBasic it
works without problems. I testet with PHP 5.2.2/3/4/5 (snaps and zend.com),
5.3.0-dev(snap from today).

Reproduce code:
---------------
Because of comercial licence ist not reproducible for the comunity :-/
//Following works fine:
$comObjPi = new COM('PISDK.PISDK');
$server = $comObjPi->Servers->Item("123.123.123.123");
$server->Open("123.123.123.123;UID=foo;pwd=bar");
$point = $server->PIPoints("SINUSOID");
echo "\n Last value: ".$point->Data->SnapShot()->Value."\n";
echo "\n Last Timestamp: ".$point->Data->SnapShot()->TimeStamp."\n";
com_load_typelib('PISDK.PISDK');
//the following throws exceptions:
try{
  $value = $point->Data->ArcValue(new Variant(mktime(), VT_R8),
rtBefore);
  echo "\n Value before now (last value):
".$point->Data->SnapShot()->Value."\n";
} catch(Exception $e){
  print("\nException ".$e->getMessage()."
TraceString:".$e->getTraceAsString());
}

Expected result:
----------------
Last value: 47.11
Last Timestamp: 123456789
Value before now (last value): 47.11


Actual result:
--------------
Last value: 47.11
Last Timestamp: 123456789
Exception Parameter 0: Typkonflikt.  //Type-Mismatch in the english
version
 TraceString: #0 C:\php_pi\pitest.php(10):
variant->ArcValue(Object(variant), 6)
#1 {main}

-- 
Edit bug report at http://bugs.php.net/?id=43521&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43521&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43521&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43521&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43521&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43521&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43521&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43521&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43521&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43521&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43521&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43521&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43521&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43521&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43521&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43521&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43521&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43521&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43521&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43521&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43521&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43521&r=mysqlcfg

Reply via email to