.NET COM Interop on Windows 7 64Bit gives me a headache

01/05/2010 - 02:00 von Kevin Stumpf | Report spam
Hey guys,

.NET COM interop so far always has been working quite nicely. Since I upgraded to Windows 7 I don't get my .NET COM objects to work anymore.

My COM object is as easy 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
{
}
}


assembly is marked ComVisible as well.

I register the assembly using
regasm /codebase /tlb "path"

registers successfully (admin mode).
I tried regasm 32 and 64bit. Both time I get the error
"ActiveX component can't create object: 'Crap.MyClass'" while executing:

dim objReg
Set objReg = CreateObject("Crap.MyClass")
MsgBox typename(objReg)
MsgBox "ok"

fuslogvw doesn't give me any hints either.

That COM object works perfectly on my Vista 32 Bit machine.

I don't understand why I haven't been able to google a solution for that problem.. am I really the only person that ever got into that problem?

Looking at OleView I see my object is registered successfully. I am able to create other COM objects as well.. it only does not work with my own ones.

Thank you,
Kevin



Submitted via EggHeadCafe - Software Developer Portal of Choice
Using VSTO Add-In To Automate Frequent Excel 2007 Tasks
http://www.eggheadcafe.com/tutorial...-auto.aspx
 

Lesen sie die antworten

#1 Kevin Stumpf
01/05/2010 - 02:06 | Warnen spam
Sorry guys for some reason that one line got lost:

That script gives me the error

"ActiveX component can't create object: 'Crap.MyClass'"

Thank you



Kevin Stumpf wrote:

.NET COM Interop on Windows 7 64Bit gives me a headache
30-Apr-10

Hey guys,

.NET COM interop so far always has been working quite nicely. Since I upgraded to Windows 7 I don't get my .NET COM objects to work anymore.

My COM object is as easy 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
{
}
}


assembly is marked ComVisible as well.

I register the assembly using
regasm /codebase /tlb "path"

registers successfully (admin mode).
I tried regasm 32 and 64bit. Both time I get the error
"ActiveX component can't create object: 'Crap.MyClass'" while executing:

dim objReg
Set objReg = CreateObject("Crap.MyClass")
MsgBox typename(objReg)
MsgBox "ok"

fuslogvw doesn't give me any hints either.

That COM object works perfectly on my Vista 32 Bit machine.

I don't understand why I haven't been able to google a solution for that problem.. am I really the only person that ever got into that problem?

Looking at OleView I see my object is registered successfully. I am able to create other COM objects as well.. it only does not work with my own ones.

Thank you,
Kevin

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Report Engine, Part 4
http://www.eggheadcafe.com/tutorial...art-4.aspx

Ähnliche fragen