开发者

calling dll function from php program

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 g开发者_开发知识库et_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..


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜