# include & lt; Windows. H> Int WINAPI WinMain (HINSTANCE HINSTANCE, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { Double PI=3.14 MessageBox (NULL, TEXT (PI), TEXT (" PI "), 0). return 0; }
There are many online, have said is very simple, using cstrings transformation, opinions vary, all cannot come true, all say so it is feasible, but how cstrings statement definition is a hard, just with & lt; Windows. H> Conflict, if the operation, help solve once, CString str; STR. The Format (" % d ", S * 4/100); MessageBox (NULL, TEXT (STR), TEXT (" PI "), 0).
CodePudding user response:
Prompt what mistake? Above
CodePudding user response:
The integer or floating point number into a string to display
CodePudding user response:
Double PI=3.14; TCHAR ch [100]. _stprintf (ch, TEXT (" % lf "), PI); MessageBox (NULL, ch, TEXT (" PI "), 0).
If is an integer string with % d, % u
CodePudding user response:
Yi, my 3rd floor,, if you are not new MFC project, but the win32 console application, at the time of using messageBOX may need to add a macro 'L'
CodePudding user response:
Not ah, prompt undefined identifiers "_stprintf "I am not new MFC project, it is a simple win32 program, I am a beginner, the original is playing console, now want to transplant a few small things to MessageBox, what also don't succeed, is simple in theory, to put the Numbers into a character, and also is the wide character,