PDA

View Full Version : How to access custom control value



marketware
11-04-2011, 08:59 AM
I have added a custom Checkbox Control to the SQLServerSelect dialog and would like to access its value in my installscript. Can someone please help me to know how to use this function correctly (or another function), etc. so I can use to access it's value? I've tried the following function (CtrlGetState) but It doesn't seem to work as expected, or I'm probably doing it wrong.

I'm probably coding it wrong. Can someone please give me guidance. THANKS!!!!!!!!

I've tried the following, but I'm not getting it right (or its the wrong function)

NUMBER nState, nResult;
STRING szIfEncrypt,szMsg,szServer;

//Control Identifier
#define ENCRYPTCHECKBOX 17818

////////////////////////////////////////
//Display dialog

Dlg_SQLServerSelect:

szMsg = "";
szServer = MW_SERVERNAME;

SQLRTInitialize2();

nResult = SQLServerSelect( szMsg, szServer );

/////////////////////////////////////////
//Here it is

nState = CtrlGetState("DialogId_10110", ENCRYPTCHECKBOX);

//The (name) of the checkbox is CheckBox1, its Control Identifier is 17818.
//The Dialog name seems to be DialogId_10110 and it's Resourse Identifier is 10110. I've also tried "SQLServerSelect" with the same results.


if (nState = BUTTON_CHECKED) then
MessageBox( "button checked", 0 );
szIfEncrypt = "true";

endif;

Roman1
11-04-2011, 09:41 AM
Hi,

you have to overwritten the function SQLServerSelect
from SQLServerSelectDlg.rul

You have to put another parameter to this function,
which gives back the state of a button.

Let's look at AskOptionsDlg.rul how to get the button state.

marketware
11-04-2011, 12:21 PM
I did as you recommended and it is working great now.

Thank you.