N
Nadav
Hi,
Introduction
***************
I have a system build of a collection of 'Native COM objects' and '.NET COM interop' objects, all of the COM objects are managed through a 'Native COM' layer, this layer manage the underlying COM Objects and upon request, provide a pointer to those objects to the 'API Consumer', following is an illustration of the system:
API Consumer ( Native C++/C# )
||
*******************************************
* Native COM Management layer *
*******************************************
||
==============
|| ||
Native COM .NET COM Interop
Object Object ( C# )
The problem:
*****************
When the 'API Consumer' uses Native C++ COM, there is no problem getting the underlying COM interface of the '.NET COM interop' object from the Management layer, BUT when the 'API Consumer' is written in C# the interface query fails with the following error: "QueryInterface for interface ISomeInterface failed.", following is the flow of the two scenarios:
1. Native C++ 'API Consumer':
***********************************
1.1. Use Native C++ to access the Management later COM ( Native )
1.2. Use the 'Native Management COM layer' to get the
interface of the '.NET COM interop' object.
1.3. The Native C++ Consumer SUCCESSFULLY uses
the interface provided by the 'Native Management COM layer'.
2. Managed C# 'API Consumer'
************************************
1.1. Use Managed C# to access the Management later COM ( Native )
1.2. Use the 'Native Management COM layer' to get the
interface of the '.NET COM interop' object results "QueryInterface
for interface ISomeInterface failed."
Following is the code flow:
1. Start the Managed C# client.
2. Create Native C++ COM management layer.
3. Create Managed C# COM interop object ( by the management layer ).
4. Ask the management layer for a certain interface of the Managed C# COM object <= Returns "QueryInterface
for interface ISomeInterface failed."
Why can't I get the interface of the managed C# COM? why does a Native C++ consumer has no problem getting the interface and a managed C# consumer does?
ThanX
Nadav.
Introduction
***************
I have a system build of a collection of 'Native COM objects' and '.NET COM interop' objects, all of the COM objects are managed through a 'Native COM' layer, this layer manage the underlying COM Objects and upon request, provide a pointer to those objects to the 'API Consumer', following is an illustration of the system:
API Consumer ( Native C++/C# )
||
*******************************************
* Native COM Management layer *
*******************************************
||
==============
|| ||
Native COM .NET COM Interop
Object Object ( C# )
The problem:
*****************
When the 'API Consumer' uses Native C++ COM, there is no problem getting the underlying COM interface of the '.NET COM interop' object from the Management layer, BUT when the 'API Consumer' is written in C# the interface query fails with the following error: "QueryInterface for interface ISomeInterface failed.", following is the flow of the two scenarios:
1. Native C++ 'API Consumer':
***********************************
1.1. Use Native C++ to access the Management later COM ( Native )
1.2. Use the 'Native Management COM layer' to get the
interface of the '.NET COM interop' object.
1.3. The Native C++ Consumer SUCCESSFULLY uses
the interface provided by the 'Native Management COM layer'.
2. Managed C# 'API Consumer'
************************************
1.1. Use Managed C# to access the Management later COM ( Native )
1.2. Use the 'Native Management COM layer' to get the
interface of the '.NET COM interop' object results "QueryInterface
for interface ISomeInterface failed."
Following is the code flow:
1. Start the Managed C# client.
2. Create Native C++ COM management layer.
3. Create Managed C# COM interop object ( by the management layer ).
4. Ask the management layer for a certain interface of the Managed C# COM object <= Returns "QueryInterface
for interface ISomeInterface failed."
Why can't I get the interface of the managed C# COM? why does a Native C++ consumer has no problem getting the interface and a managed C# consumer does?
ThanX
Nadav.