c++ - Dealing with MFC form 'text' as char type or regular string type -
while modifying mfc form written others, visual studio 2012, encountered problem.
in form, there input box takes entire path of file. ex) c:\folder1\test_file.wav
, in code, this->tb_path->text
contains this.
first problem cannot find method deal this->tb_path->text
char*
or char
type array use methods in string.h
in status quo, code uses
system:: string ^filename = this->tb_path->text + "_re";
to modify text, hampers various modifications of file path. how can solve problem?
try
system::string ^filename = gcnew system::string(this->tb_path->text + "_re");
or may be
system::string ^filename = gcnew system::string(this->tb_path->text + _t("_re"));
it seems me not doing required allocation in memory gcnew, garbage inside string uninitialized memory.
Comments
Post a Comment