Re: Using DLL with PHP
| From: | Shawn McKenzie | Date: | Tue, 10 Feb 2009 18:14:03 +0000 |
| Subject: | Re: Using DLL with PHP | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.general php.general |
| Request: | Send a blank email to php-general+get-288074@lists.php.net to get a copy of this message | ||
Dan Shirah wrote:
> Alrighty, so I went a different route...
>
> I created my own ActiveX DLL...one that I know I can register.
>
> Starting out really simple:
>
> //My VB code
> Public Function hello() As String
>
> hello = "Hello World!"
> End Function
>
> //My PHP code
> <?php
> function Hello() {
> $new_com = new COM("DMStoTIFF.conv");
> $output=$new_com->hello();
> echo $output;}
> Hello();
> ?>
>
> So, after I register the DLL on the server my PHP page is correctly
> displaying the "Hello World!" dialog.
>
> What I'm having problems with now is trying to pass a variable to the DLL.
>
> Shouldn't I be able to do this just like any other PHP class/function?
>
It doesn't appear that your function accepts a parameter. What does
this do:
//VB
Public Function hello(ByVal name As String) As String
hello = "Hello " & name & "!"
End Function
//PHP
echo $new_com->hello("Dan");
--
Thanks!
-Shawn
http://www.spidean.com