"Displaying a file"
-
Which? Open a file or get path of a file?
WhiteSky
i should be able to open and display the contents to the user .. harsha
-
Have you tried the following: Open File
HANDLE CreateFile( LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile );
Read Contents:BOOL ReadFile( HANDLE hFile, // handle of file to read LPVOID lpBuffer, // pointer to buffer that receives data DWORD nNumberOfBytesToRead, // number of bytes to read LPDWORD lpNumberOfBytesRead, // pointer to number of bytes read LPOVERLAPPED lpOverlapped // pointer to structure for data );
Read File[^] Open File[^] Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's..... :) :) Programm3r
My Blog: ^_^i dont want to read or open or create a file.. i want to display a file to the user say when user clicks a button. will this help in that regard ? harsha
-
Hi, If iknow the filename and its path i hould be able to open and display that file.if any ideas on how to do it please let me know.. harsha
If its a simple text file using
CEditView
will do, try creating simple SDI application and choose baseclass asCEditView
in last step of app wizard.Prasad Notifier using ATL | Operator new[],delete[][^]
-
i should be able to open and display the contents to the user .. harsha
Use of
CFile::Read
WhiteSky
-
If its a simple text file using
CEditView
will do, try creating simple SDI application and choose baseclass asCEditView
in last step of app wizard.Prasad Notifier using ATL | Operator new[],delete[][^]
its a ".chm" (Compiled Html file).. harsha
-
its a ".chm" (Compiled Html file).. harsha
Use of
HtmlHelp
WhiteSky
-
i dont want to read or open or create a file.. i want to display a file to the user say when user clicks a button. will this help in that regard ? harsha
harsh_2961 wrote:
i dont want to read or open or create a file.. i want to display a file to the user say when user clicks a button. will this help in that regard ?
If you want to see file's content you have to open it. There is no other way than opening given file to read it, and if you want to display it's content you have to read it first. Unless you are talking about viewing file's... name? :^)
-
i dont want to read or open or create a file.. i want to display a file to the user say when user clicks a button. will this help in that regard ? harsha
Hope I understood your question use of a
CFileDailog
and when he clicks ok button show file name(Is your purpose)
WhiteSky
-
its a ".chm" (Compiled Html file).. harsha
Have you considered using
ShellExecute(..., "open", "file.chm", ...)
?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
Have you considered using
ShellExecute(..., "open", "file.chm", ...)
?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
thanks a lot.. its working perfectly:)