tags:

views:

64

answers:

2

I've made a program in php where i got to call a dll function.. that dll contains some hashcode.. i call this dll's function from vb6 through this code:

Private Declare Function GetHash Lib "hashGen.dll" (ByVal tEncode As String) As Long
Private Sub get_Key()
    MsgBox GetHash("hello world")
end sub

can anybody tell me how to call this function in PHP?

here's my dll file:
http://www.4shared.com/file/-hdichIS/hashGen.html

thnx..

+1  A: 

You can use SWIG to wrap it in PHP extension and then load it via dl.

Milan Babuškov
+1 looks good. -
Pekka
A: 

I don't think this is possible out of the box.

There are dynamically loadable PHP extensions in DLL form, loadable using dl() but I strongly assume they have interfaces and functions speficic to a PHP extension.

Possibilities:

  • Build a wrapper EXE that uses the DLL and call the executable

  • Turn your DLL into a PHP extension (See @Milan's answer for details)

  • Run the DLL on the local system using rundll or similar

  • Introduce your DLL's functionality as a COM Object

Pekka