Click here to Skip to main content
15,891,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to decode a wav file Pin
Hamid_RT29-Sep-08 7:27
Hamid_RT29-Sep-08 7:27 
QuestionPrint all the running Applications using C++, win APIs. Pin
Subrat 470826627-Sep-08 1:16
Subrat 470826627-Sep-08 1:16 
AnswerRe: Print all the running Applications using C++, win APIs. Pin
CPallini27-Sep-08 1:21
mveCPallini27-Sep-08 1:21 
GeneralRe: Print all the running Applications using C++, win APIs. Pin
Subrat 470826627-Sep-08 2:46
Subrat 470826627-Sep-08 2:46 
GeneralRe: Print all the running Applications using C++, win APIs. Pin
CPallini27-Sep-08 3:28
mveCPallini27-Sep-08 3:28 
GeneralRe: Print all the running Applications using C++, win APIs. Pin
Subrat 470826627-Sep-08 3:51
Subrat 470826627-Sep-08 3:51 
AnswerRe: Print all the running Applications using C++, win APIs. Pin
Mark Salsbery27-Sep-08 8:45
Mark Salsbery27-Sep-08 8:45 
GeneralRe: Print all the running Applications using C++, win APIs. Pin
Subrat 470826629-Sep-08 1:24
Subrat 470826629-Sep-08 1:24 
I got the soln.Now problem is I want to store all app names inside a container(Vector).And finally calling a function to print it.But that function is unable to print these application names correctly.


#include "vector"
using namespace std;

wchar_t szText[256];//Holds app name

//Print function
void PrintText(vector<wchar_t*> apps) {
for (vector<wchar_t*> ::iterator itr = apps.begin();
itr != apps.end();
++itr) {
wprintf(L"%s \n", *itr);
}
}

vector<wchar_t*> r_apps;

//Inside callback func
bool callbackfn(.....) {
......
......
......
// if printing szText using wprintf() it is printing the app names correctly.

//using vector to store all these app names
r_apps.push_back (szText);
}

//Main func
int _tmain(int argc, _TCHAR* argv[])
{
.......
.......
PrintText(r_apps);
return 0;
}


PrintText() is unable to print the app names correctly.
My o/p comes like below:

?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????

// If using wprintf() above 'r_apps.push_back (szText);' statement then o/p come like belows.


C:\WINDOWS\System32\cmd.exe
AppPrint - Microsoft Visual Studio
CodeProject: Visual C++ / MFC Discussion Boards. Free source code and programmin
g help - Mozilla Firefox

Registry Mechanic
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????
?????????????????????????↕?A?↕?A?↕?↕??????????????????????????

Please help me in this regard.
GeneralRe: Print all the running Applications using C++, win APIs. Pin
Mark Salsbery29-Sep-08 6:34
Mark Salsbery29-Sep-08 6:34 
GeneralRe: Print all the running Applications using C++, win APIs. Pin
Subrat 47082664-Oct-08 21:04
Subrat 47082664-Oct-08 21:04 
GeneralRe: Print all the running Applications using C++, win APIs. Pin
Mark Salsbery6-Oct-08 5:33
Mark Salsbery6-Oct-08 5:33 
AnswerRe: Print all the running Applications using C++, win APIs. Pin
Hamid_RT29-Sep-08 7:25
Hamid_RT29-Sep-08 7:25 
QuestionText Draw Pin
trioum27-Sep-08 0:23
trioum27-Sep-08 0:23 
AnswerRe: Text Draw Pin
followait27-Sep-08 3:27
followait27-Sep-08 3:27 
QuestionEdit Box problem Pin
MsmVc26-Sep-08 23:47
MsmVc26-Sep-08 23:47 
QuestionRe: Edit Box problem Pin
CPallini27-Sep-08 3:31
mveCPallini27-Sep-08 3:31 
AnswerRe: Edit Box problem Pin
MsmVc28-Sep-08 19:35
MsmVc28-Sep-08 19:35 
QuestionRe: Edit Box problem Pin
CPallini28-Sep-08 21:55
mveCPallini28-Sep-08 21:55 
AnswerRe: Edit Box problem Pin
MsmVc28-Sep-08 23:28
MsmVc28-Sep-08 23:28 
QuestionRe: Edit Box problem Pin
CPallini28-Sep-08 23:38
mveCPallini28-Sep-08 23:38 
AnswerRe: Edit Box problem Pin
Hamid_RT29-Sep-08 7:22
Hamid_RT29-Sep-08 7:22 
GeneralRe: Edit Box problem Pin
MsmVc1-Oct-08 2:40
MsmVc1-Oct-08 2:40 
GeneralRe: Edit Box problem Pin
Hamid_RT1-Oct-08 8:41
Hamid_RT1-Oct-08 8:41 
QuestionDialogBox Problem Pin
ashishmax4726-Sep-08 23:22
ashishmax4726-Sep-08 23:22 
AnswerRe: DialogBox Problem Pin
CPallini26-Sep-08 23:45
mveCPallini26-Sep-08 23:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.