加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

使用DLL与PHP for Dummies

发布时间:2020-12-14 01:39:56 所属栏目:Windows 来源:网络整理
导读:我有一个需要使用 PHP访问DLL的项目.服务器是Windows机器,Apache服务器由XAMPP提供. 我在网上看过多个答案 Use DLL in PHP? php communication with dll? calling dll through php http://ca.php.net/manual/en/class.com.php http://ca2.php.net/manual/en/
我有一个需要使用 PHP访问DLL的项目.服务器是Windows机器,Apache服务器由XAMPP提供.

我在网上看过多个答案

> Use DLL in PHP?
> php communication with dll?
> calling dll through php
> http://ca.php.net/manual/en/class.com.php
> http://ca2.php.net/manual/en/book.w32api.php
> http://www.talkphp.com/absolute-beginners/3340-php-how-load-com-dll-file.html

这是我如何在HTA / Javascript中调用DLL:

< object style =“display:none”id =“SOME_ID”classid =“clsid:SOME_CLASS_ID”codebase =“./ somePath.dll”>< / object>

有人有工作的例子吗?

这是我迄今为止在PHP中所尝试的:

$obj = new COM('pathTo.dll');

关于DLL的信息:

>使用Delphi编译
这是(当然)自制的
>当我尝试使用regsvr32注册DLL时,我收到以下错误,DllRegister Server入口点未找到

可以使用regsvr32吗?

当您创建DLL文件时,您需要使用 module definition file.它将包含类似于此的内容:
;
;contains the list of functions that are being exported from this DLL
;

DESCRIPTION     "Simple COM object"

EXPORTS
                DllGetClassObject       PRIVATE
                DllCanUnloadNow         PRIVATE
                DllRegisterServer       PRIVATE
                DllUnregisterServer     PRIVATE

该定义允许regsvr32找到DllRegisterServer入口点.

您可以尝试的另一个选项是将/ n标志传递给regsvr32.

Regsvr32 [/u] [/n] [/i[:cmdline]] dllname

/u – Unregister server

/i – Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall

/n – do not call DllRegisterServer; this option must be used with /i

/s – Silent; display no message boxes (added with Windows XP and Windows Vista)

最终,在尝试使用PHP进行DLL工作之前,您需要确保DLL的工作原理.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读