First Problem is you can't use C++ strings directly with wxTextCtrls. You've to use wxString.
Code: Select all
wxString SupV;
SupV=WxEditLedresistor1->GetValue();
Now
atoi returns an Integer. So you need an Integer variable to be declared. So you can't use
SupV as
char * and then redefine it again as
int.
So replace the following code
Code: Select all
const Char* SupV;
SupV=WxEditLedresistor1->GetValue();
atoi(&SupV);
with
Code: Select all
wxString SupV;
int iSupV;
SupV=WxEditLedresistor1->GetValue();
SupV.ToLong(&iSupV);
Now do the same with others similar parts.
Now as you've converted the string to integer, you need to change it wxString again before feeding it to SetValue(). Change the following code
Code: Select all
WxEditLedresistor5->SetValue(Resistance);
to
Code: Select all
WxEditLedresistor5->SetValue(wxString::Printf(wxT("%d"), Resistance));
Also remember to not redefine a variable (with same name) within a scope, i.e., within a function.
Hope this solves your problem.
Regards,
Biplab