Managed C++ extensions and ICE

in Help Center
I tried to insert some simple ICE code in my existing program, which is written using MS managed C++ extensions. And I got all sort of compilation errors. From the error messages I understand that ICE header files redefine some standard managed C++ definitions. My question is: is it possible to make managed extensions and ICE work together? If it is possible, could you give guidelines how to do this?
I use ICE v 2.0 and MS VS .NET 2003.
Thanks,
Sergei.
I use ICE v 2.0 and MS VS .NET 2003.
Thanks,
Sergei.
0
Comments
Cheers,
Michi.
I made the program compile!
There were two symbols redefined "MessageBox" and "GetObject". After I undefined them (and defined them back after problem lines using push_macro and pop_macro pragmas) compilation was successful. I'm still not sure if this is it. Will continue tests and will add more ICE code.
Thanks,
Sergey.
Cheers,
Michi.
Regards,
Sergei.
Regards,
Sergei.
If you use the Slice-to-C# compiler to generate C# skeleton and proxy code, and then compile them into MSIL using Microsoft's C# compiler, the result is a set of .NET classes which can be used from any other .NET language. You can then write your servant classes and client code in C#, VB.NET, Managed C++, or any other language for which a .NET compiler exists.
Thanks,
Sergei.
What I've done to build a client:
1. Produced a cs file from slice definition file (slice2cs).
2. Opened new C# library project and inserted generated cs file. Added a reference to icecs.dll
3. Built that library.
4. Removed all the Ice headers from managed C++ code. Inserted references to the produced library and to icecs.dll instead.
5. Replaced the Ice C++ mapping code with the C# one. For example, instead of using IceUtil::createProperties(...) used Ice::Util::createProperties() or replaced XxxxPrx::checkedCast(...) with XxxxPrxHelper::checkedCast(). So actually I used C# Ice mapping in C++ code.
And the client worked! And, BTW, no need to change "define" directives (see my previous posts above), because there are no Ice headers in the code.
I've not tried to make a server in managed C++ yet. Will try soon.
Sergei.
Regards,
Sergei.