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