ローカルメンバーCRadioDialog.hがあると仮定します。
std::vector <CString> textBoxText;
CString*の代わりにCStringheareを使用することをお勧めします
CRadioDialog.hにメソッドを追加できます。
void fill_my_vector( std::vector<CString>& out_vector );
およびCRadioDialog.cpp:
void CRadioDialog::fill_my_vector( std::vector<CString>& out_vector )
{
std::copy ( textBoxText.begin(), textBoxText.end(), out_vector.begin() );
}
CRadioDialog :: OnBnClickedOk()で、ローカルtextBoxTextにcstringをすでに入力しています
呼び出しコード:void main_window :: caller(){..。
std::vector <CString> results;
CRadioDialog dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
dlg.fill_my_vector( results );
/* USE YOUR VECTOR */
}
...
}
これは最良の最適化方法ではありませんが、理解しやすい方法です。それが役に立てば幸い。