Kbase P132544: Assigning an ABL class to a .NET property whose type is System.Object results in error 223
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  09/02/2011 |
|
Status: Verified
SYMPTOM(s):
Assigning an ABL class to a .NET property whose type is System.Object results in error 223
Assigning an ABL class to a .NET property results in error 223
** Incompatible data types in expression or assignment. (223)
Example:
THIS-OBJECT:propGridLabelAppearances:SelectedObject = NEW AppearancesFilter(THIS-OBJECT:ultraLabel1).
Casting the ABL class object to type System.Object has no effect
FACT(s) (Environment):
Property is expecting an object of type System.Object
Windows
OpenEdge 10.2x
CAUSE:
This is expected behavior. The code is trying to assign an ABL class into a property whose type is System.Object. This cannot be done. The compiler error is correct (incompatible types). All .NET classes inherit from System.Object, which in turn inherits from Progress.Lang.Object, but ABL classes do not inherit from System.Object, i.e. the hierarchy is:
P.L.O
|
<user-defined class>
FIX:
In order to be able to assign an ABL class into a System.Object, it must inherit from System.Object:
P.L.O
|
S.O
|
<.NET classes>