Help!automatically read the file
-
Hi guys, is there any method for retrieve the previose opend file (in the last excution of the program)when the program just being start again? sorry for my english.... what i want is... my program has opened a text file, let's say data10.txt... then close the program .. open it, then the program while automatically the data10.txt which it has read last time the file is a text file, so cannot use serializing.:) thank u in advance!!!!!!!!!!
-
Hi guys, is there any method for retrieve the previose opend file (in the last excution of the program)when the program just being start again? sorry for my english.... what i want is... my program has opened a text file, let's say data10.txt... then close the program .. open it, then the program while automatically the data10.txt which it has read last time the file is a text file, so cannot use serializing.:) thank u in advance!!!!!!!!!!
-
Hi guys, is there any method for retrieve the previose opend file (in the last excution of the program)when the program just being start again? sorry for my english.... what i want is... my program has opened a text file, let's say data10.txt... then close the program .. open it, then the program while automatically the data10.txt which it has read last time the file is a text file, so cannot use serializing.:) thank u in advance!!!!!!!!!!
You will need to save the last filename used somewhere, like the registry, in HKCU\Software\jfk_lili\appname\LastFile, for example. Then on startup, you need a mechanism to detect that the program had no arguments, and then force it to load that file. If you were using MFC, for instance, you could override your InitInstance to examine the program's command line, where it uses CCommandLineInfo, and if the verb was FileNew, change it to FileOpen and fill in the m_strFileName member. You then call ProcessShellCommand, and it happens automatically. Steve S Developer for hire