0

I im using dev c++ to create open dialog and i need to write in MessageBox error message "Unable to open file C:\test.txt" i try with this code:

MessageBox(hwnd, "Unable to open file "&(LPSTR)szFileName, "Error", MB_OK | MB_ICONERROR);

But it gives me error about char complains...how can i add string with variable value in messagebox?

char szFileName[MAX_PATH]; is defined with this and its value for this example is "test.txt"

How can i display this string+variable value(filename) in msgbox?

John
  • 1,521
  • 3
  • 15
  • 31

0 Answers0