Archived

This forum has been archived. Please start a new discussion on GitHub.

using IcePack with c#

I am a beginer on Ice, I find that there is no demos about IcePack with c#,
How to use IcePack with c#,and which function in c# acts as IcePack::QueryPrx.CheckedCast() in c++?

thank you !,I love Ice .

Comments

  • Sorry, at the moment, there is no demo for using IcePack with Icicle. The next release will fix this.

    If you want to use IcePack, use the demo that comes with Ice for Java as a guide. The C# code will be very similar to the Java code.

    In C#, you do a checked cast by calling checkedCast on the generated helper. (See page 268 in the manual.)

    So, to narrow the IcePack::Query proxy, you can do:
    Ice.ObjectPrx obj = ...;
    IcePack.QueryPrx q = IcePack.QueryPrxHelper.checkedCast(obj);
    

    Cheers,

    Michi.
  • Thank you !

    but which files need to be included if using IcePack with c#?
    otherwise there is error ,I find.
    thank you
  • Just add the IcePack Slice definitions (in ice/slice/IcePack) to the set of Slice files for your application. (You will need to run slice2cs with the --ice option to compile those definitions.)

    Cheers,

    Michi.