2013-07-06 46 views
0

我正在嘗試如何在php上使用我的.net編碼的dll函數。我一直在努力和研究幾個小時,仍然無法實現它的工作。 PHP版本是5.4.4在PHP上使用.NET dll

錯誤消息:
致命錯誤:未捕獲的異常 '發出com_exception' 與消息 '未能創建COM對象`php4winbook.examples':用C無效語法':\ XAMPP \ htdocs中\ testdll \ index.php:13堆棧跟蹤:#0 C:\ xampp \ htdocs \ testdll \ index.php(13):com-> com('php4winbook.exa ...')#1 {main}拋出C :\ XAMPP \ htdocs中\ testdll上線13

我已經試過\的index.php:

http://www.peachpit.com/articles/article.aspx?p=27291http://geekswithblogs.net/tkokke/archive/2009/04/24/how-to-use-.net-assemblies-in-php.aspx

我發現迄今最好的資源......

我的代碼:

<?php 
$test = new COM("php4winbook.examples"); 
$hellmes = $test->showname("Andrew"); 
echo $hellmes; 
?> 

.NET的DLL的代碼,只是一個簡單的Hello World。 「使裝配COM-Visible」選項被檢查並用鑰匙簽名。

codes

添加到裝配: enter image description here

但是我無法找到C內的例子:/窗/ assembly文件夾。

回答

0

在COM類中使用它之前,您需要在Windows中註冊您的DLL。