Kbase P145112: How to embed an ABL window in a .NET form?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  1/10/2011 |
|
Status: Unverified
GOAL:
How to embed an ABL window in a .NET form?
GOAL:
Is is possible to have an ABL window embedded in a .NET form?
FACT(s) (Environment):
OpenEdge 10.2x
Windows
FIX:
In order to embed an ABL window (.W) in a .NET form, changes must be made to the AppBuilder-generated code in order to prevent it from enabling. The .W must be enabled/visualized via the Progress.Windows.WindowContainer control. If the .W has not been configured correctly then error 14837 will okay when running the ABL Form.
The window may not be embedded because it has already been realized. (14837)
Perform the following steps:
ABL Window (.W)
1) In the "Runtime Attributes and AppBuilder Settings" section, change "C-Win:HIDDEN = no." to "C-Win:HIDDEN = yes.". For example:
IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(C-Win)
THEN C-Win:HIDDEN = yes.
2) In the Main Block, comment out the following statement:
RUN enable_UI.
ABL .NET Form (.CLS)
1) Add a Progress.Windows.WindowContainer to the .NET form and define the handles:
DEFINE PRIVATE VARIABLE h AS HANDLE NO-UNDO.
DEFINE PRIVATE VARIABLE hWin AS HANDLE NO-UNDO.
2) In the constructor method, after the InitializeComponent() method add:
RUN <ABL_WINDOW>.w PERSISTENT SET h.
hWin = h:CURRENT-WINDOW.
windowContainer1:EmbeddedWindow = hWin.
/* Resize windowContainer1 to size of ABL Window */
/* windowContainer1:Size = NEW System.Drawing.Size( hWin:WIDTH-PIXELS, hWin:HEIGHT-PIXELS ).*/
/* Resize windowContainer1 to size of Form */
windowContainer1:Size = NEW System.Drawing.Size( THIS-OBJECT:WIDTH, THIS-OBJECT:HEIGHT ).
/* Reposition windowContainer1 to top-left corner */
windowContainer1:Location = NEW System.Drawing.Point(0,0).
windowContainer1:PARENT = THIS-OBJECT.
windowContainer1:Show().
RUN enable_UI IN h.
3) Add the following code to the destructor method:
IF VALID-HANDLE(h) THEN DO:
DELETE OBJECT h.
END.