Bug #43521 [Opn->Fbk]: Problem with Variant/Parameters

From: Date: Tue, 06 Apr 2021 11:24:15 +0000
Subject: Bug #43521 [Opn->Fbk]: Problem with Variant/Parameters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233212@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=43521&edit=1

 ID:                 43521
 Updated by:         cmb@php.net
 Reported by:        oespeter at gravityshock dot biz
 Summary:            Problem with Variant/Parameters
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            COM related
 Operating System:   Win2k; Win2003 Server
 PHP Version:        5.2.5
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

mktime() returns an integer (32bit on x86), and so the conversion
to VT_R8 might fail, or maybe ArcValue() doesn't accept a VT_R8.
But anyhow, there may not be the need to pass a variant; wouldn't
it work if you pass the return value of mktime() directly?


Previous Comments:
------------------------------------------------------------------------
[2007-12-06 16:25:19] oespeter at gravityshock dot biz

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 this bug report at https://bugs.php.net/bug.php?id=43521&edit=1


Thread (3 messages)

« previous php.bugs (#233212) next »