Re: passing an array to a COM object?

From: Date: Tue, 07 Nov 2000 21:14:34 +0000
Subject: Re: passing an array to a COM object?
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-3717@lists.php.net to get a copy of this message
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> -----------------------------------------------------------------

« previous php.windows (#3717) next »