G
Guest
Hello Gurus;
I have some strange, complicated and challenging question.
This question may show a poor design, and I agree it very poor. But I have
some constrainment that must be handled as I'll show in here (you know...
plaster/banded...):
I have a C# Form with a COM/OCX control (unmanaged...).
I need to get the pointer for a specific interface of the COM control to be
used in another C++ DLL (with clr support), and in the C++ to use an
unmanaged/native code to access the COM control.
In this COM control interface there is a function that only exist in the
specific interface. I need to invoke this com function in a native syntax
from the C++ DLL (unmanaged code) directly to the COM control interface (also
unmanaged).
I need to do that because the C++ DLL has a lot of data that need to be send
to the COM control. But if this data will be sent to the COM control through
the .NET application (managed part), the data will be copied (memory copy)
from the unmanaged code to the managed code, and again from the managed code
to the unmanaged COM control.
I wish to avoid this data copy by letting the C++ component set the data
directly to the COM control (unmanaged to unmanaged = NO copy!).
Note that the control in instantiated in the .NET/C++ application which in
managed.
How can I do that in the .NET/C# side and in the C++ side?
- - - -
Thanks
Sharon
I have some strange, complicated and challenging question.
This question may show a poor design, and I agree it very poor. But I have
some constrainment that must be handled as I'll show in here (you know...
plaster/banded...):
I have a C# Form with a COM/OCX control (unmanaged...).
I need to get the pointer for a specific interface of the COM control to be
used in another C++ DLL (with clr support), and in the C++ to use an
unmanaged/native code to access the COM control.
In this COM control interface there is a function that only exist in the
specific interface. I need to invoke this com function in a native syntax
from the C++ DLL (unmanaged code) directly to the COM control interface (also
unmanaged).
I need to do that because the C++ DLL has a lot of data that need to be send
to the COM control. But if this data will be sent to the COM control through
the .NET application (managed part), the data will be copied (memory copy)
from the unmanaged code to the managed code, and again from the managed code
to the unmanaged COM control.
I wish to avoid this data copy by letting the C++ component set the data
directly to the COM control (unmanaged to unmanaged = NO copy!).
Note that the control in instantiated in the .NET/C++ application which in
managed.
How can I do that in the .NET/C# side and in the C++ side?
- - - -
Thanks
Sharon