.NET COM compatibility has always worked pretty well so far. Since I upgraded to Windows 7, I no longer try to work with my .NET COM objects.
My COM object is as simple as:
namespace Crap { [ComVisible(true)] [Guid("2134685b-6e22-49ef-a046-74e187ed0d21")] [ClassInterface(ClassInterfaceType.None)] public class MyClass : IMyClass { public MyClass() {} public void Test() { MessageBox.Show("Finally got in here."); } } } namespace Crap { [Guid("1234685b-6e22-49ef-a046-74e187ed0d21")] public interface IMyClass { } }
also marked ComVisible.
I register the assembly using
regasm /codebase /tlb "path"
successfully registered (administrator mode). I tried regasm 32 and 64bit. Both times I get an error
"ActiveX component cannot create a Crap.MyClass object" using this vbscript:
dim objReg Set objReg = CreateObject("Crap.MyClass") MsgBox typename(objReg)
dim objReg Set objReg = CreateObject("Crap.MyClass") MsgBox typename(objReg)
fuslogvw doesn't give me any hints either. This COM object works fine on my Vista 32 bit machine.
I do not understand why I could not find a solution for this problem. Am I really the only person who ever got into this problem?
Looking at OleView, I see that my object is successfully registered. I can also create other COM objects, but it does not work only with mine.
Thanks Kevin
Twinhabit
source share