mixint c# with c++

HI,

In my project I am using c# lib which is using OpenXMl internally I like to use this in Native CPP and Managed CPP .

Important is I like to use as a member of C# class to Cpp Class.
as well as c++ code is written in Com+ATL+using other C++ lib like Boost.

Plm is I can not make this as a member variable to the C++ class , as well as

if I do so by using ref key word I need to change whole cpp class.

There is also the heavy dependency of theses class to other cpp classes.

I can not post the code chunk due to official restrictions.







closed account (13bSLyTq)
Hi,

I never did this type of mixing, however I am accustom to integration of C++ native code with C# dependent code.

- Create a C++ native project (needs to support arguements)
- include: using System.Diagnostics;
- The use Process.Start() to give arguments and such

OR you could go the Redirection route - most commonly used purpose is Command Line redirection:

http://www.youtube.com/watch?v=BDTCviA-5M8

Last edited on
HI Thanks...

but the scenario that you have understood is bit different.
i dont need any thing related to command line.

I get the solution from the following link but stuck in some point
http://support.microsoft.com/kb/828736


That it is possible that i can have interface which has some method which return run time object if i am in c++ i will say it can return

interface MyInterface
{
virtual void * GetObject()=0;

};

class MyDerived : MyInterface
{

public:
void * GetObject()
{
return reinterpret_cast <void *>(this);

}

};
----------------

The above code compiles beautifully but fails when u say:-

MyInterface *myIptr = new MyDerived();

Error 2 error C2243: 'type cast' : conversion from 'MyDerived *' to 'MyInterface *' exists, but is inaccessible

I need same in c# because my interface needs to return the duplicate copy of the object
if some work around i will happy !!







Topic archived. No new replies allowed.