Php-PHP calls the dll component written in C # and prompts FailedtocreateCOMobject.

Source: Internet
Author: User
PHP calls the dll component written in C #. it has already been registered and loaded, but the prompt FailedtocreateCOMobject 'codedata. GetData & #39; is displayed on PHP. thank you for your consideration. C # dll generation, set and modify the following steps: 1. select "register for COMinterop" in the Build attribute; 2. sign (signing) select "sign for assembly" for the property. 3. create a new signature with a name. 4. deselect the "use password to protect the key file" check box. 5. modify the project Property File (AssemblyInfo. cs), confirm [assembl phpdllc #

PHP calls the dll component written by C #. it has been registered and loaded, but the prompt is still displayed in PHP.
Failed to create COM object 'codedata. getdata'

Thank you for solving the problem.

C # dll generation. the following steps are modified:

1. select "register for COM interop" in the Build attribute"

2. select "sign for Assembly" in the signature attribute ";

3. create a new signature with a name;

4. deselect the password check box to protect the key file;

5. modify the project Property File (AssemblyInfo. cs) and confirm [assembly: ComVisible (true)].

Use the Visual Stdio command prompt for manual registration:

Gacutil/I CodeData. dll

Regasm CodeData. dll

All prompts that the operation is successful.

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': Fig

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.