10-03-2008 11:55 AM
How can I access the member functions of a CNiButton using Measuement studio?
I have tried the following:
//Header file
public:
CNiButton *T1;
//implementation file
//OnInitDialog()
T1=(CNiButton *) GetDlgItem(IDC_CWBOOLEAN1);
//ClickCwboolean1()
bool flag=T1->GetValue();
Compiles ok.
When run & Boolean is clicked, Results in 'Unhandled Exception'
10-06-2008 01:00 PM
Hi Mike,
You do not need to use the GetDlgItem command in your code. In your code you should have the expression DDX_Control(pDX, IDC_CWBOOLEAN1, T1); which already gets the value from the dialog. Without the GetDlgItem command, you also no longer need to use a pointer for T1. You can just use the GetValue function to access the member function. You can check out the project I have attached to see how this is done.