How can I get rid of this error and other while compiling the below code?
#include "stdafx.h"
#include
#include
#include &
Your title says strcpy
but your code and errors have FindFirstFile
?
Anyway, declaring your buffer like this will help:
TCHAR chFolderpath[_MAX_PATH];
Then you will want to use Even better, _tcscpy
and _tcscat
instead of strcpy
and strcat
.#include
and use the string functions that protect against buffer overrun.
Regarding AfxMessageBox
, this is not a standard Windows function. It's part of MFC, I suppose you cut and pasted from an example that used MFC. Windows has a MessageBox function which you can use, but you'll need to supply all the parameters (parent window, message, title, buttons).