Php-php calls C # written DLL component, prompting failed to create COM object

Source: Internet
Author: User
Keywords PHP DLL C #
phpdllc#

PHP calls C # Write DLL component, registered loaded, but still a hint on PHP
Failed to create COM object ' Codedata.getdata '

Solution Ah, thank you.

C#dll build, the settings modify the following steps:

1. In the build attribute, select "Register for COM Interop"

2. In the signature (signing) attribute, select "Sign the assembly";

3, create a new signature, a name;

4. Uncheck the use password to protect the key file;

5. Modify the project Properties file (AssemblyInfo.cs) and Confirm [Assembly:comvisible (true)].

and manually register using the visual stdio command prompt:

gacutil/i CodeData.dll

RegAsm CodeData.dll

are prompt for success.

The PHP environment configuration is normal,

echo "OK";
try{
$com = new COM ("Codedata.getdata");
$result = $com->getdata ();
echo $result;
}
catch (Exception $e) {
Print_r ($e->getmessage ());
}
$com = null;
?>

Such a piece of code, can output OK, and failed to create COM object ' Codedata.getdata '

okfailed to create COM object ' Codedata.getdata ': Ч﷨

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.