Page 1 of 1

eXpress++ DCREAD GUI PARENT @oDlg

Posted: Mon Nov 21, 2022 2:50 pm
by slobodan1949
Roger,
what is the function does: DCREAD GUI PARENT @oDlg ?
what is the function does: DCREAD GUI PARENT oDlg ?
Both of these commands work but the behavior of the program is not the same.

Re: eXpress++ DCREAD GUI PARENT @oDlg

Posted: Mon Nov 21, 2022 4:28 pm
by rdonnay
.. PARENT @oDialog is used when DCREAD GUI automatically creates the dialog window for you, which is almost always.
@oDialog is used to create a pass-by-reference pointer to store a variable to the DC_XbpDialog1() object for use later in the program.

If you don't use @oDialog, but use only oDialog, then DCREAD GUI is expecting that you already have a pointer to a dialog window that will be used for all the DC* objects that will be created.

This may sound complicated to you but it really isn't as long as you always let DCREAD GUI create your dialog window.
As a habit, you can use DCREAD GUI PARENT @oDialog all the time, but then you should have LOCAL oDialog at the beginning of the function.

Re: eXpress++ DCREAD GUI PARENT @oDlg

Posted: Tue Nov 22, 2022 11:18 am
by slobodan1949
Thanks Roger,
now everything is clear.