I found this great example on this issue:
http://www.codeproject.com/managedcpp/unmanaged_to_managed.asp
unfortunatelly , it only works on v.s.net 2003 , and in order to compile it in v.s.net 2005 with the /clr option, you have to make a lot of changes in the code like replacing _gc with ref and alot of other things. I tried to do it, but after all the changes, it still didn't work
can someone refer me to an example which is suited to the new visual c++ syntax or explain how to migrate from the managed c++ extensions to the new semantics
thanks, Uri

Calling Managed Code from Unmanaged Code ?????
MariaJeff
It was the same in VC++ 2003 too. To add a .NET reference, you need /clr compilation.
Alternatively, you can use CCW as I mentioned.
bev a
Marcin Belczewski
Amanda Theo
Calling managed code from native code is essentially as simple as enabling /clr compilation and adding a reference to the managed assembly. Once you do that, you can directly use the managed classes from your code.
Alternatively, if you do not want to enable /clr, you could use CCW, though you won't be able to use objects that do not have default constructors, and all the COM stuff may be a trifle confusing if you are not used to BSTRs and SAFEARRAYs.
Arnaud H
Hi, you were right after all!
the link that I brougt at the top of this page was refering to a project that has been done on v.s.net 2003 before the CLR option was introduced in v.s.net 2005. that's why it's not straightforward solution.
thank you , I'll recommend your replies.
larsw
I was not talking of RCW, I was talking about CCW - they do opposite things.
And you can reference a C# lib from a C++/CLI lib. I don't understand why you say that's not possible.
C++/CLI can be used to do "everything" that can be done with any other CLI language.
Henio
no, it's not correct what you wrote.
you can use Rcw only if you're are trying to reference the nanaaged code from a Com object(you need to have a file extension tlb) , but if you're trying to reference it from a native c++ code ,, you can't use the Rcw.
also, you can't reference a c# class library project from a class library CLR project,