how i show a dWord value in Messagebox api function
i want show a message dialog with a dword value like this
MessageBox(0, (LPCWSTR) hProcess ,TEXT("My MessageBox Info"),MB_OK | MB_ICONERROR);
hProcess is a DWORD value but it when messag开发者_StackOverflow社区ebox appear , body part of message that should show dowrd value is empty.
TCHAR msg[100];
StringCbPrintf(msg, 100, TEXT("%d"), hProcess);
MessageBox(NULL, msg, TEXT("My MessageBox Info"), MB_OK | MB_ICONERROR);
char *s = (char*)malloc(10);
sprintf(s, "%d", hProcess);
MessageBox(NULL, s, ...);
free(s);
First convert the value to a string, then display it in message box.
Take a look at this: ultoa
精彩评论