|
|
|
|||||
|
Going from "in" to "out" param, using a class as a union
Hi!
Given the following slice defs: class A {...}; // no methods class B extends A {...}; // no methods class C extends A {...}; // no methods interface IceIsCool { bool Wow(A); }; I am using the A class as a "union", because in my code I instantiate objects of say type BPtr , and make proxy calls like MyIceIsCoolPrx->Wow(myBPointerObject); In the implementation of the Wow operation, on the server side, I am doing a BPtr::dynamicCast(myAPtrParameter) in order to access all of B's members. Everything worked fine until I realized I would like to make the parameter to the Wow operation an "out" parameter. So I changed my slice definitions to class A {...}; // no methods class B extends A {...}; // no methods class C extends A {...}; // no methods interface IceIsCool { bool Wow(out A); }; and in my implementation of the IceIsCoolI class I removed the const keyword from the operation's signature to make it compliant with the slice2cpp's output. When I recompile now, I get an error message because the compiler expects an object of type APtr as a parameter to the MyIceIsCoolPrx->Wow(myBPointerObject); call. So my question is, why was it OK to pass an object of type BPtr to the operation call when it had an "in" parameter and it is not OK when the parameter is declared as an "out" parameter? A call like MyIceIsCoolPrx->Wow(APtr::dynamicCast(myBPointerObject)); doesn't help either. Thanks Catalin |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unknow exception in "Printer" sample code | wangh705 | Help Center | 6 | 10-26-2006 01:01 PM |
| Don't "Ice-3.1.1-VC71.msi " include the "slice2java.exe"? | Jason Gao | Help Center | 4 | 10-26-2006 12:23 PM |
| Icepack registry "TimeOut" exception with heavy load | eaglecn | Help Center | 1 | 05-26-2006 01:02 AM |
| PermissionDeniedException ,reason is "internal server error" | ewiniar | Help Center | 2 | 05-18-2006 06:55 AM |
| "Invalid UTF8 string" when transer chinese chars between cpp server and csharp client | raygo | Help Center | 8 | 03-21-2006 09:34 PM |