Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

member functions of CNiButton

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'

0 Kudos
Message 1 of 2
(6,125 Views)

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.

 

 

0 Kudos
Message 2 of 2
(6,088 Views)