There are basically four methods to run a command in Visual C++.
· system(), _wsystem()
· ShellExecute() or ShellExecuteEx()
WinExec is provided only for compatibility with 16-bit Windows. Applications should use the CreateProcess function.
To get the name of files in a folder,
1. call the FindFirstFile function to open a search handle and get information about the first file that the file system find in the folder.
2. call the FindNextFile function to continue listing files from a previous call to FindFirstFile. Continue reading
Using Win32 API FindFirstFile we can find whether a given file exists in the given path (szFilePath) or not.
BOOL IsFileExists( LPCTSTR szFilePath) method shown below serves our purpose.
BOOL IsFileExists( LPCTSTR szFilePath) // szFilePath in | file path
hFind = FindFirstFile(szFilePath, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
bFileExists = FALSE;
bFileExists = TRUE;
Cryptography is the use of codes to convert data so that only a specific recipient will be able to read it.
Microsoft provide win32 API to Hash Data/string. The class CHashDataProvider developed to provides simple function HashData(ALG_ID algorithmID, LPCTSTR plainText, LPTSTR hashedText); which takes algorithmID and inputText to convert plainText to hashedText
ALG_ID algorithmID – Algorithm ID to be used
LPCTSTR plainText – plainText that to be converted to hashedText
LPTSTR hashedText – Hashed Test using the input algorithmID