在PHP中使用DLL? [英] Use DLL in PHP?

查看:99
本文介绍了在PHP中使用DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不会撒谎。我不是所有熟悉的Windows和COM对象。这就是为什么我在这里。首先,是否可以从PHP脚本中运行Apache来访问DLL?在我围绕互联网的旅程中,我相信我有两个选项:

I'm not going to lie. I'm not all the familiar with Windows and COM objects. That's why i'm here. First of all is it possible to access a DLL from within a PHP script running out of Apache? In my journey around the internets i believe that i have 2 options:


  1. 编译dll作为PHP的扩展。 (我没有使这个DLL)

  2. 访问DLL作为一个COM对象,这是为它的设计反正。

所以我采用COM方法。

So i'm taking the COM approach.

try{
  $com = new COM('WHAT_GOES_HERE');
} catch(Exception $e){
    echo 'error: ' . $e->getMessage(), "\n";
}

我如何去找出什么会进入初始化字符串?是有一个com查看器类型的程序,我可以/应该使用找到这个?与这个DLL相关的文档似乎没有指定什么字符串,我应该使用来初始化,但深入到什么流可用,以及各种有趣的东西。只是经过这个初始的驼峰。请帮助!

How do i go about finding out what would go into the initialization string? is there a com viewer type program i could/should be using to find this out? the documentation associated with this DLL doesn't seem to specify what strings i should be using to initialize but gets very in-depth into what streams are available, and all sorts of fun stuff. just gotta past this initial hump. Please help!

推荐答案

WHAT_GOES_HERE 是ProgID,Class ID或Moniker

WHAT_GOES_HERE is the ProgID, Class ID or Moniker registered on the Operating System.

这些可以更改为在不同计算机上注册的同一个DLL。有几种方法来找到一个注册的DLL的ProgID / CLSID / Moniker。你可以在网上搜索dll debugger,dll export,dll inspect,你会看到几个解决方案,还有一些方法来显示什么函数dll导出,以便您可以使用它们。

Each of these can change for the same DLL registered on different machines. There are several ways to find what's the ProgID/CLSID/Moniker of a registered dll. You can search the web for "dll debugger", "dll export", "dll inspect" and you'll see several solutions, and also ways to show what functions the dll export so you can use them.

最简单的方法,你可以注册dll与Regsvr32.exe和搜索窗口的注册与regedit.exe的dll的名称,你可能需要搜索几次,直到你找到 \HKEY_CLASSES_ROOT\ ,这是ProgID。

The easiest way, you can just register the dll with Regsvr32.exe and search Window's register with regedit.exe for the dll's name, you might need to search several times until you find the key under \HKEY_CLASSES_ROOT\, which is the ProgID.

命令dcomcnfg.exe显示了很多关于COM的信息对象。

The command dcomcnfg.exe shows a lot of information about COM objects.

如果你有Visual Studio,OLE / COM对象查看器(oleview.exe)可能是有用的。

If you have Visual Studio, the OLE/COM Object Viewer (oleview.exe) might be useful.

这篇关于在PHP中使用DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆