Re: COM and the PHP equivalent of ASP Currency data type

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

 



Alex Bovey schreef:
> Hi all,
> 
> I am working with a COM interface and the specification which is wrtten for
> ASP calls for a "Currency" data type to be passed to a function.  What is
> the equivalent in PHP?
> 
> If I call com_print_typeinfo() I can see that the function has the following
> info:
> 
>     function GetPrice(
>         /* VT_PTR [26] [in][out] --> VT_VARIANT [12]  */ &$Account,
>         /* VT_PTR [26] [in][out] --> VT_CY [6]  */ &$Quant,
>         /* VT_PTR [26] [in][out] --> VT_I2 [2]  */ &$QuantMult,
>         /* VT_PTR [26] [in][out] --> VT_I2 [2]  */ &$prMult
>         )
> 
> The parameter I am having problems with parameter 2 - $Quant.
> 
> I tried to create a VARIANT of type VT_CY so I did:
> 
> $qty = new VARIANT('1.0000', VT_CY);

total guess work from me:

$qty = new VARIANT('1', VT_CY);

i.e. use an 'int' rather than a 'float'

or maybe just

$qty = new VARIANT(1);

> 
> The error I am getting is:
> 
> Uncaught exception 'com_exception' with message 'Parameter 2: Type mismatch.
>

you might try catching the exception and see if it contains any more
useful info.

> 
> Thanks all,
> 
> Alex
> 
> -
> 
> Alex Bovey
> Web Developer | Alex Bovey Consultancy Ltd
> Registered in England & Wales no. 6471391 | VAT no. 934 8959 65
> PHP | MySQL | AJAX | XHTML | CSS | Javascript | XML | W3C Accessibility
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux