Fails to convert process name to wxString
Vadim Zeitlin
vadim at wxwidgets.org
Thu Nov 1 13:57:49 PDT 2007
On Thu, 1 Nov 2007 22:51:01 +0200 Eran Ifrah <eran.ifrah at gmail.com> wrote:
EI> >>"name" now contains the correct data. What you do with it next is another
EI> >>story.
EI> I am simply returning it to the caller, here is the code snippet:
EI>
EI> if(pe.th32ProcessID == (DWORD)pid){
EI> wxString name(pe.szExeFile);
EI> wxMessageBox(name);
EI> CloseHandle (hProcessSnap);
EI> return name;
EI> }
EI>
EI> and this is the function prototype:
EI> wxString ProcUtils::GetProcessNameByPid(long pid);
EI>
EI> To prove my point (mostly to myself), I added a wxMessageBox() call right
EI> after the conversion (or to be accurate, the assignment) took place:
EI>
EI> wxString name(pe.szExeFile);
EI> wxMessageBox(name);
EI>
EI> the output can is not readable (see attachment in my previous email).
It looks almost like it's the ANSI version of the message box that is
being called... Try calling Windows MessageBoxW() function directly with
pe.szExeFile -- it should work. Try calling it now with name -- it should
work too.
Does it?
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list