[PHP] COM and the PHP equivalent of ASP Currency data type

2008-12-04 Thread Alex Bovey
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.', VT_CY);

The error I am getting is:

Uncaught exception 'com_exception' with message 'Parameter 2: Type mismatch.


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] COM and com_safearray_proxy objects

2008-11-04 Thread Alex Bovey
Hi all,

I'm trying to get my head around COM and interfaces and I'm making
slow progress but have hit a problem.

I have an IProduct interface and using com_print_typeinfo($iproduct) I
can see it has the following property (amongst others):

/* DISPID=1745027081 */
var $Description;

/* DISPID=1745027081 */
/* VT_BSTR [8] */
var $Description;

If I do var_dump($iproduct-Description) I get the following output:

object(com_safearray_proxy)#7 (0) {}

Now I have no idea what a com_safearray_proxy object is at all, and
googling it hardly produces any results so I can't imagine it's very
common.

Any ideas how I am to access that property in my code?

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



Re: [PHP] COM and VARIANT types

2008-11-04 Thread Alex Bovey
 I think this may be what you are looking for, but I don't know how
 much it helps:

 http://www.marin.clara.net/COM/variant_type_definitions.htm

 Andrew

Thanks Andrew - it's a start!

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



[PHP] COM and VARIANT types

2008-11-03 Thread Alex Bovey
Hi,

I am playing around with some COM interfaces and getting my head
around VARIANTs.

I have a method that is returning a VARIANT and using variant_get_type
returns the type as 9.  How do I find out what type 9 relates to?  The
manual page for variant_get_type isn't much...

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



[PHP] Accessing form values from multi selects or checkboxes

2004-08-24 Thread Alex Bovey
Hi,

Is there a way I can access the values selected in a multi-select dropdown
or group of checkboxes without appending square brackets to the name of the
input field in my form so that it automatically becomes an array in PHP?

i.e. rather than this:

select name=fruit[] multiple size=5option
value=appleapple/optionoption value=orangeorange/option/select

I would like to be able to do this, but still access the elements:

select name=fruit multiple size=5option
value=appleapple/optionoption value=orangeorange/option/select


Basically I am using a JavaScript chained select function which complains
when I use square brackets in a field name, and before I start hacking the
code I wanted to see if there was an alternative way of doing it server
side.

Thanks all,

Alex

-- 

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