Hi
I have made a command line tool which converts a particular log file in .bin format to a text file.
But as of now the names of these files are hardcoded i.e it converts log.bin to log.txt.
Here is the function call
int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
ConvertDatalogToText( "log.bin", "log.txt",
"dump.txt", true );
return 0;
}
I concerned with the first three files
It picks up log.bin from the directory and using a dump.txt file in the same dir it generates the text file with name log.txt.
Thus if i use this tool like this -
> Convert.exe log.bin dump.txt
This works fine and log.txt is generated.
However i now Want that i should not have any limitation on the names. i.e Whatever *.bin argument is given in the command line tool should be picked up , also same name should be used for the text file.
for e.g if i give
> Convert.exe sample_log.bin new_dump.txt
then it should pick up the file name sample_log.bin and new_dump.txt from the dir and generate sample_log.txt
Also , for more information
LPTSTR lpCmdLine argument of AfxWinMain function has the following definition
typedef LPSTR LPTSTR;
typedef CHAR *LPSTR ;
Thus LPTSTR is just a char pointer.
Right now the file names are hardcoded as shown in the function call above.
Please help me remove this restriction.
Thanks in advance
Regards
Nikhil