Hi,
I have a COM method that is called from VBA. This COM method in turn
calls CoCreateInstanc e 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 CoCreateInstanc e 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 --CoCreateInstanc e on COM wrapped .NET class
This does not work (And results in a Class Not Registered Error then
a
security error if CoCreateInstanc e is called again):
..NET class --VBA-->COM-->CoCreateInstan ce on COM wrapped .NET class
The .NET assemblies are not in the GAC -- they are in the same
directory.
Any thoughts?
Thanks,
Sherri 6 3618
VBA and VB6 are not equal. You also should not be able to go from your COM
class (VB6 I am assuming) to VBA.
"ranin02" wrote:
Hi,
I have a COM method that is called from VBA. This COM method in turn
calls CoCreateInstanc e 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 CoCreateInstanc e 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 --CoCreateInstanc e on COM wrapped .NET class
This does not work (And results in a Class Not Registered Error then
a
security error if CoCreateInstanc e is called again):
..NET class --VBA-->COM-->CoCreateInstan ce on COM wrapped .NET class
The .NET assemblies are not in the GAC -- they are in the same
directory.
Any thoughts?
Thanks,
Sherri
On Jan 15, 12:23*pm, Family Tree Mike
<FamilyTreeM... @discussions.mi crosoft.comwrot e:
VBA and VB6 are not equal. *You also should not be able to go from your COM
class (VB6 I am assuming) to VBA.
The COM classes are all C++. Not using VB6 anywhere, only VBA (within
Excel). There is no problem with the VBA-->COM communication or COM--
>COM wrapped .Net communication. No problem, that is, until the top
level .Net class is introduced.
Thanks,
Sherri
Then I believe you will find that C++ -VBA gives the problem also.
"ranin02" wrote:
On Jan 15, 12:23 pm, Family Tree Mike
<FamilyTreeM... @discussions.mi crosoft.comwrot e:
VBA and VB6 are not equal. You also should not be able to go from your COM
class (VB6 I am assuming) to VBA.
The COM classes are all C++. Not using VB6 anywhere, only VBA (within
Excel). There is no problem with the VBA-->COM communication or COM--
COM wrapped .Net communication. No problem, that is, until the top
level .Net class is introduced.
Thanks,
Sherri
On Jan 15, 1:29*pm, Family Tree Mike
<FamilyTreeM... @discussions.mi crosoft.comwrot e:
Then I believe you will find that C++ -VBA gives the problem also.
Not sure what you mean. I am able to launch the VBA macro from my
(C#) .Net assembly just fine, and the macro in turn instantiates COM
classes and calls COM methods just fine, and these COM methods call
CoCreateInstanc e on pure COM classes just fine. It is only when it
attempts to call CoCreateInstanc e on a class that is a COM
visible .Net class that it has a problem. So it seems to be a .Net
issue -- it is only when there is .Net on the top AND .Net on the
bottom that it has the problem. If there is .Net only on the top, but
not on the bottom, no problem, and vice versa.
Thanks,
Sherri
I apologize, as I appear to have complete misunderstood the problem earlier.
Is the .net class at the bottom of the chain trying to start a new chain?
That is, what is the logic at the bottom of the chain that is different than
on entry?
And, by the way, there are strange postings going on all over this board on
MSDN. I hope this doesn't further confuse the issue!
"ranin02" wrote:
On Jan 15, 1:29 pm, Family Tree Mike
<FamilyTreeM... @discussions.mi crosoft.comwrot e:
Then I believe you will find that C++ -VBA gives the problem also.
Not sure what you mean. I am able to launch the VBA macro from my
(C#) .Net assembly just fine, and the macro in turn instantiates COM
classes and calls COM methods just fine, and these COM methods call
CoCreateInstanc e on pure COM classes just fine. It is only when it
attempts to call CoCreateInstanc e on a class that is a COM
visible .Net class that it has a problem. So it seems to be a .Net
issue -- it is only when there is .Net on the top AND .Net on the
bottom that it has the problem. If there is .Net only on the top, but
not on the bottom, no problem, and vice versa.
Thanks,
Sherri
On Jan 15, 8:54*pm, Family Tree Mike
<FamilyTreeM... @discussions.mi crosoft.comwrot e:
I apologize, as I appear to have complete misunderstood the problem earlier. *
Is the .net class at the bottom of the chain trying to start a new chain? *
That is, what is the logic at the bottom of the chain that is different than
on entry?
And, by the way, there are strange postings going on all over this board on
MSDN. *I hope this doesn't further confuse the issue!
At the bottom level, there is a COM class that is trying to call
CoCreateInstanc e on a COM visible dotnet class. This COM class is
calling CoCreatInstance on a lot of COM classes, which works fine in
both cases -- both when the chain was initiated by an assembly and
when it wasn't. But when it calls CoCreateInstanc e on the .Net class,
in the case when things were initiated by an assembly at the top
level, the CoCreateInstanc e fails with Class Not Registered, then the
next time with a security exception -- it never even reaches the .Net
class in this case. Please note that NOTHING is different from VBA on
down in both cases. The only thing that is different when it works
and when it doesn't is that in the case it works, the VBA macro is
called directly from Excel, and in the case when it doesn't, the VBA
macro is launched from an assembly by calling Application.Run . And in
the case when it doesn't work, calls to CoCreateInstanc e on regular
COM objects work fine, just the call to CoCreateInstanc e on the COM
Visible .NET class doesn't work.
I have both assemblies (and all intermediate files) located in the
same directory, and for the time being I gave that directory full
trust with the .NET framework config utility.
Thanks,
Sherri This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Lady_A |
last post by:
I have created a basic COM in-proc server and a client.
The registration of my server succeeds according to
regsvr32.
I can see it in the registry, having the ProgID and the
InProcServer32 entries.
I can't seem to find it in the OLE/COM Viewer unless I
specifically open the tlb file.
Opening the dll file by the same method displays an error
loading the type lib, although the dialog box specifies
that I can put in a dll file.
|
by: Tim Kiely |
last post by:
I have a managed C++ class that exposes a COM object to ASP.NET. This
COM object creates several other COM objects internally. A VS.NET
2002 build of the dll works fine on .NET 1.0 and 1.1. A VS.NET 2003
build, however, fails when the COM object calls CoCreateInstance.
This happens only if the .NET type is used by two web applications on
the same server. The first web app to create the .NET type always
succeeds and the second web app...
|
by: Ken Allen |
last post by:
I have a number of services developed in C# (.Net), and they have been
working fine for the most part. Recently someone reported that ipon
occassion (originally rarely, but more frequently on some systems of
late), there is an entry in the Event Log immediately after a boot
indicating that the service failed to start after 30,000 milliseconds.
Usually it starts fine when attempting manually after the boot.
I instrumented the code to...
|
by: Naveen |
last post by:
Hi
I have a component writtten in vc++ registered in MTS. I use MFC DLL which initializes and creates an instance and uninitialize of this MTS component. I use COInitialize ,COCreateInstance and CoUninitialize to perform this. The method which contains this CoInitialize ,CoCreateInstace and CoUninitialize is called by a ATL DLL. When i try to compile this ATL DLL it hangs while performing registration. But if i remove the CoCreateInstance call...
|
by: JohnR |
last post by:
From reading the documentation, this should be a relatively easy thing. I
have an arraylist of custom class instances which I want to search with
an"indexof" where I'm passing an instance if the class where only the
"searched" property has a value. I expected to get the index into the
arraylist where I could then get the entire class instance. However, the
'indexof' is never calling my overloaded, overrides Equals method. Here is
the...
| |
by: rithish |
last post by:
I am on IE 6. I was trying out a simple xmlhttp function that send
GET/POST requests. However, IE throws an 'unspecified error' when I
call the 'setRequestHeader' method.
The function that I am trying out is give below. Am I doing something
wrong? Any help is greatly appreciated.
/*
|
by: Frederic Rentsch |
last post by:
Hi all,
I have a class Time_Series derived from list. It lists days and
contains a dictionary of various Lists also derived from list which
contain values related to said days. (e.g. Stock quotes, volumes traded,
etc.)
I defined an operator += which works just fine, but only once. If I
repeat the operation, it fails and leaves me utterly mystified and crushed.
Craving to be uncrushed by a superior intelligence.
|
by: igd |
last post by:
Hello!
I would like to code a wrapper for the C/C++-ASIO API. In one of the
functions exported by an unmanaged ASIO driver DLL (loadAsioDriver)
CoCreateInstance is called. When I call loadAsioDriver() from an
unmanaged client, it works but when I call that function from managed
code (P/Invoke) CoCreateInstance in loadAsioDriver() returns
E_NOINTERFACE. How can I fix this?
Thanks in advance!
|
by: MikeT |
last post by:
This may sound very elementary, but can you trap when your object is
set to null within the object?
I have created a class that registers an event from an object passed
in the constructor. When my object is destroyed, I want my object to
un-register this event. If I don't then the object would never be
destroyed until the object I passed in the constructor is destroyed.
I have implemented a Dispose(), Dispose(bool), and ~Finalize...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |