php-PHP调用C#写的dll组件,提示Failed to create COM object

WBOY
Release: 2016-06-02 11:32:21
Original
2005 people have browsed it

phpdllc#

PHP调用C#写的dll组件,已注册已加载,但是在PHP上仍然是提示
Failed to create COM object `CodeData.GetData'

求解啊,谢谢了。

C#dll生成,设置修改了以下步骤:

1、在生成(Build)属性里选中“为 COM interop 注册”

2、在签名(signing)属性选中“为程序集签名”;

3、新建一个签名,起个名字;

4、取消勾选使用密码保护密钥文件;

5、修改工程属性文件(AssemblyInfo.cs),确认 [assembly: ComVisible(true)] 。

并且使用Visual Stdio的命令提示符里进行手动注册:

gacutil /i CodeData.dll

regasm CodeData.dll

均提示成功。

PHP环境配置是正常的,

echo "OK";
try{
$com = new Com("CodeData.GetData");
$result = $com->GetData();
echo $result;
}
catch(Exception $e){
print_r($e->getMessage());
}
$com = null;
?>

这么一段代码,可以输出OK,还有Failed to create COM object `CodeData.GetData'

OKFailed to create COM object `CodeData.GetData': ��Ч���﷨

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template