Discussion:
CoCreateInstance fails when COM method calling it was called from assembly
(too old to reply)
ranin02
2008-01-14 15:38:59 UTC
Permalink
Raw Message
Hi,

I have a COM method that is called from VBA. This COM method in turn
calls CoCreateInstance on a class that is a .NET class with a COM
wrapper around it. This all works fine. However, when I kick off
that VBA routine from a .NET class within an assembly, I get a class
not registered error. When CoCreateInstance is called on that COM
visible .Net class a second time, then there is a security violation.
To try to make it clearer:

This works:
VBA -- > COM --> CoCreateInstance on COM wrapped .NET class

This does not work (And results in a Class Not Registered Error then a
security error if CoCreateInstance is called again):
.NET class --> VBA-->COM-->CoCreateInstance on COM wrapped .NET class

The .NET assemblies are not in the GAC -- they are in the same
directory.

Any thoughts?
Thanks,
Sherri
Johan
2011-02-25 11:53:37 UTC
Permalink
Raw Message
Hi Sherry

I have a similar problem. Did you ever find out the root cause for this?

Thanks
/Johan
Post by ranin02
Hi,
I have a COM method that is called from VBA. This COM method in turn
calls CoCreateInstance on a class that is a .NET class with a COM
wrapper around it. This all works fine. However, when I kick off
that VBA routine from a .NET class within an assembly, I get a class
not registered error. When CoCreateInstance is called on that COM
visible .Net class a second time, then there is a security violation.
VBA -- > COM --> CoCreateInstance on COM wrapped .NET class
This does not work (And results in a Class Not Registered Error then a
.NET class --> VBA-->COM-->CoCreateInstance on COM wrapped .NET class
The .NET assemblies are not in the GAC -- they are in the same
directory.
Any thoughts?
Thanks,
Sherri
Submitted via EggHeadCafe
LINQ executed in Parallel (PLINQ)
http://www.eggheadcafe.com/tutorials/aspnet/042c0b06-95f2-4944-9b52-46be6eeb3e7d/linq-executed-in-parallel-plinq.aspx
Loading...