thejaisjoy wrote: > Following is my issue. > > ------------------------------------------- > > I have a unmanaged application ( C++ , .exe ) which has a class > CMyClass > with a public member fMyFunct(). You can assume this C++ application > is built with /clr option. > > I need to instantiate CMyClass in a different managed ( C# ) > application and call fMyFunct(). > > Many thanks if any of you can send me a sample which demonstrate above > things ( Remember I can't manipulate C++ application apart from > project settings. But you can do anything in C# application ) > > ---------------------------------------------------- > > Please note I am using Visual Studio 2005
You can't do that. At least not the way you want. You have to at least export the function and compile the application with the new export (although treating EXEs as DLLs with LoadLibrary() gets weird and usually runs into address loading conflicts so the library relocater kicks in). Then you can create an unmanaged VC++ .NET DLL that accesses the new export in the EXE. Then you can access the function from C#. BTW, this is not a C# or .NET list. I've never built anything with .NET nor have any desire to do so either. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
