K
karim_nih
Guest
i created a vb6 COM dll and call the dll in php. how can i return a array of string from vb6 to php? here is the code:
VB6
Public Function GetArray() As String()
Dim sport(5) As String
'declaring an array
sport(0) = "Soccer"
sport(1) = "Cricket"
sport(2) = "Rugby"
sport(3) = "Aussie Rules"
sport(4) = "BasketBall"
sport(5) = "Hockey"
GetArray = sport
End Function
php
$hello = new COM("Hello.clsHello") or die("Unable to instantiate Hello.clsHello");
echo "VB6 dll = ".$hello->HelloWorld();
$arr = array($hello->GetArray());
echo '<pre>';
//var_dump($arr);
print_r($arr);
echo '</pre>';
echo "<br>VB6 = ".count($arr);
VB6
Public Function GetArray() As String()
Dim sport(5) As String
'declaring an array
sport(0) = "Soccer"
sport(1) = "Cricket"
sport(2) = "Rugby"
sport(3) = "Aussie Rules"
sport(4) = "BasketBall"
sport(5) = "Hockey"
GetArray = sport
End Function
php
$hello = new COM("Hello.clsHello") or die("Unable to instantiate Hello.clsHello");
echo "VB6 dll = ".$hello->HelloWorld();
$arr = array($hello->GetArray());
echo '<pre>';
//var_dump($arr);
print_r($arr);
echo '</pre>';
echo "<br>VB6 = ".count($arr);