###First problem
First problem
Instead of using:
v_ports.push_back = "Com1"; v_ports.push_back = "Com4"; you should use:
v_ports.push_back("Com1"); v_ports.push_back("Com4"); because std::vector<T>::push_back is a function.
###Second problem
Second problem
The _T macro is supposed to be used on literals:
Use the _T macro to conditionally code literal strings to be portable to Unicode.
It cannot be used in expressions like _T(v_ports[i]).
To convert a string to unicode please see:
- Converting unicode strings and vice-versa (Philipp's answer)
- How well is Unicode supported in C++11?