Problems conversion with .net type Double

Posted by nidk on 05-Feb-2013 09:05

hi,

I have a interface with a type double property:

public interface Iproxy

{

     double Myproperty {get;}

}

i inherits whith my progress :

class myclass implements Iproxy:

{

      property override Myproperty as Double

     get():

          return 12.1.

     end.

}

This exemple in complex implementation  throw invalideCastException in my code.

When a try to make a simple exemple like this , i don't a have exemption.

If i use un new C# stucture with double value , it work.

ex:

public struct ProDouble

{

    double Value {get;}

}

public interface Iproxy

{

     ProDoubleMyproperty {get;}

}

i inherits whith my progress :

class myclass implements Iproxy:

{

      property override Myproperty as ProDouble

     get():

            define var pval as ProDouble.

           pval.Value = 12.1

          return pval.

     end.

}

it work.

I think this is a BUG ? or have a solution ?

All Replies

Posted by Admin on 05-Feb-2013 09:11

Where are you getting an InvalidCastExeceptoin (stack trace) and what's the exact message?

Posted by nidk on 05-Feb-2013 10:44

Re,


  This screenshot explain this problems.

Posted by Admin on 05-Feb-2013 12:46

Not sure, what you're trying to do...

When the .NET Interface enforces a property of type Double you need to implement it in the ABL using a DECIMAL property.

Posted by nidk on 05-Feb-2013 14:34

When i inherit progress class with c# interface with double property,

OpenEdge studio make a class with double property , not a decimal property.

this is the result:

Class myobject  implements imynetinteface :

define property Value as double.

get.

end class.

but , i thinx is better:

Class myobject  implements imynetinteface :

define property Value as decimal.

get.

end class.

but this not compile.

i use wpf , and use netinterface for use in datacontext of windows. it's work but a have this bug.

When a use encaps double object its work.

This thread is closed