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