c# - using .net dll as com in php failed -
i have .net dll want use in php application
have tested dll on .net app , worked
my c# class:
namespace cryptocs { [guid("15d16831-d6be-43c4-ab4f-f0baa35987db")] [classinterface(classinterfacetype.none)] [progid("cryptocs")] [comvisible(true)] public class crypto : icryptocs { public crypto() { } public bool login(string username, string password) { // code } } [guid("5bdbb53a-571a-4ec7-b37e-a4d2a6a54deb")] [interfacetype(cominterfacetype.interfaceisidispatch)] [comvisible(true)] public interface icryptocs { [dispid(1)] bool login(string username, string password); } }
my usage code is:
$crypto = new com('cryptocs.crypto');
this page give error:
failed create com object
i tried register dll using gacutil.exe result was:
assembly added cache
but error wasn't fixed
i tried regasm.exe , result is:
types registered successfully
still error same
i tried regsvr32.exe gabe me error:
can't find entry point
i'm on windows server 2003 sp2 using vs2010 .net4
the standard registration tool .net assemblies indeed regasm.exe, /codebase if don't put in gac (but put in gac apparently).
the progid use in php should same specified in .net, "cryptocs", instead of "cryptocs.crypto" here
also, suggest remove classinterface , interfacetype attributes, it's better use defaults in general.
Comments
Post a Comment