Why doesn't Progress.Util.TypeHelper:GetType work with o

Posted by sublam on 02-May-2016 08:04

Hello, i just found that Progress.Util.TypeHelper:GetType doesn't work for openedge classes.

Is there any way to get a System.Type object from a oe class?

(OE 11.6.1)

Posted by Mike Fechner on 02-May-2016 08:48

Can you clarify „Designer“. Did you develop a designer for a component attribute or a user control designer (designer host / design canvas)?
 
I don’t think you can create a property designer in the ABL.
 
We have built custom user control/form designers in the ABL that are also capable of creating instances of ABL user controls. If
 
Progress.Util.TypeHelper:GetType (“package.YourUserControl”)
 
failes the first time. Create a dummy instance:
 
oInstance = NEW package.yourUserControl () .
 
and then
 
Progress.Util.TypeHelper:GetType (“package.YourUserControl”)
 
should return you the hybrid System.Type and DesignerHost:CreateInstance (oType) will work.
 

All Replies

Posted by Simon L. Prinsloo on 02-May-2016 08:11

The OpenEdge base class is Progress.Lang.Object and the OpenEdge equivalent of System.Type is Progress.Lang.Class, which you get with the GetCLass() method or the GET-CLASS() function.

TypeHelper's function is to assist in getting hold of the System.Type of .Net based objects living "accross" the AVM-CLR bridge.

If you tell us what you try to do, we may be able to help you a bit better.

Posted by sublam on 02-May-2016 08:16

I try to write my own custom visual designer, everything is up and running but i now tried to create custom controls in Oe but these don't seem to work since the designer uses GetType (it least i guess so)

Posted by Mike Fechner on 02-May-2016 08:48

Can you clarify „Designer“. Did you develop a designer for a component attribute or a user control designer (designer host / design canvas)?
 
I don’t think you can create a property designer in the ABL.
 
We have built custom user control/form designers in the ABL that are also capable of creating instances of ABL user controls. If
 
Progress.Util.TypeHelper:GetType (“package.YourUserControl”)
 
failes the first time. Create a dummy instance:
 
oInstance = NEW package.yourUserControl () .
 
and then
 
Progress.Util.TypeHelper:GetType (“package.YourUserControl”)
 
should return you the hybrid System.Type and DesignerHost:CreateInstance (oType) will work.
 

This thread is closed