I hope my question is not to localized... But I think some other will stumble about this or a similar problem.
I want to create a vector which contains all available ports at my system (this works in a console app). After that I want to copy the vectorelements in a wxString-Array to get them in a wxComboBox.
So, in my particular case I get two errors:
- the variablename of the vector is not known in wxWidgets
- by copying, the wxString will cast my string into a wchar_t (I know, wchar_t and wxString are similar...)
I will add some of my Code, so you will have a better sight about the problem:
first problem
std::vector<std::string> v_ports;
v_ports.push_back = "Com1";
v_ports.push_back = "Com4";
--> error: 'v_ports' does not name a type (hint: that is a example, in the hole programm I will use a function to get the strings)
second problem
wxString sect_opt[v_ports.size()];
for(int i = 0; i < v_ports.size(); i++)
sect_opt[i] = _T(v_ports[i]);
--> error: 'Lv_ports' was not declared in this scope
I'm using: IDE: CodeLite 5.1; wxW 2.9.4; @Win8.1