RE: [PHP-WIN] passing an array to a COM object?
| From: | BCA - Jerry Jackson | Date: | Tue, 07 Nov 2000 22:44:55 +0000 |
| Subject: | RE: [PHP-WIN] passing an array to a COM object? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-3719@lists.php.net to get a copy of this message | ||
Pablo, Thanks for the suggestion! Using your method, I get a type mismatch
error in VB (I'm running the test in the VB IDE) instead of the error coming
back to the browser. The error occurs on this line:
Test = strArray(1)
Everything I've tried has failed with a type mismatch either on the PHP or
VB side of the fence. I'm starting to suspect that COM support in PHP
doesn't work at all for the passing of arrays.
-----------------------------------------------------------------
Jerry Jackson
Director of Software Development
BCA Technologies, Inc.
(407) 659-0653 ext. 320
jerry@bcatech.com <mailto: jerry@bcatech.com>
-----------------------------------------------------------------
> -----Original Message-----
> From: Pablo Vera [mailto:pvz@vercan.com]
> Sent: Tuesday, November 07, 2000 4:15 PM
> To: php-windows@lists.php.net
> Subject: Re: [PHP-WIN] passing an array to a COM object?
>
>
> Jerry:
>
> Try declaring strArray as a variant:
>
> Public Function Test(strArray As Variant) As String
> Test = strArray(1)
> End Function
>
> Saludos,
> Pablo Vera
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
> Tuesday, November 07, 2000, 1:26:21 PM, BCA wrote:
>
> BJJ> I'm getting an error when attempting to pass an array to a COM object
> BJJ> as follows:
>
> BJJ> ----------------------
> BJJ> Here's the PHP code:
>
> BJJ> $myarray[0] = "zero";
> BJJ> $myarray[1] = "one";
> BJJ> $myarray[2] = "two";
> BJJ> $myarray[3] = "three";
>
> echo $ref->>Test($myarray);
> BJJ> ----------------------
> BJJ> Here's the VB code:
>
> BJJ> Public Function Test(strArray() As String) As String
> BJJ> Test = strArray(1)
> BJJ> End Function
> BJJ> -----------------------
> BJJ> Here's the resulting error message:
>
> BJJ> Warning: Invoke() failed: Type mismatch. in
> c:\inetpub\wwwroot\php-com.php
> BJJ> on line 22
> BJJ> -----------------------
> BJJ> It works fine when try to pass in and return a simple
> non-array string.
>
> BJJ> I know I'm doing something wrong on the PHP side of the
> fence....anyone know
> BJJ> the answer? Thanks!
>
> BJJ> -----------------------------------------------------------------
> BJJ> Jerry Jackson
> BJJ> Director of Software Development
> BJJ> BCA Technologies, Inc.
> BJJ> (407) 659-0653 ext. 320
> BJJ> jerry@bcatech.com
> BJJ> -----------------------------------------------------------------
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>