Do you have an idea ?Quote:
Originally posted by Jeab.
For "PathFileExists", is the syntax OK :
if (PathFileExists(csFileName) == TRUE)
{
// Do smthg
}
The calling of this function might not be good cause "Undeclared identifier"...
Printable View
Do you have an idea ?Quote:
Originally posted by Jeab.
For "PathFileExists", is the syntax OK :
if (PathFileExists(csFileName) == TRUE)
{
// Do smthg
}
The calling of this function might not be good cause "Undeclared identifier"...
Do you ever read MSDN?It means :Quote:
PathFileExists
Determines if a file exists.
BOOL PathFileExists(
LPCTSTR pszPath
);
Parameters
pszPath
Address of the file to verify.
Return Values
Returns TRUE if the file exists, or FALSE otherwise.
Example
.............
Requirements
Version 4.71 and later of Shlwapi.dll
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 4.0 or later).
Windows 95/98: Requires Windows 98 (or Windows 95 with Internet Explorer 4.0 or later).
Header: Declared in shlwapi.h.
Import Library: shlwapi.lib.
a) you must have Internet Explorer 4.0 or later;
b) you must "#include shlwapi.h";
c) you must add shlwapi.lib in your Link "Objecl/Library modules..." settings;
How to recover the address where the files are saved ?
I use this code to open a CfileDialog for "Save as". And I want to see the ".mpg" files:
CFileDialog cfDlg(FALSE, NULL, m_csPCFileName, OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER, "*.MPG ", NULL);
But I can't see them...
Any idea ?
try this:
PS: Please read MSDN. You are not at least trying here !Code:CFileDialog cfDlg(FALSE, NULL, m_csPCFileName, OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER, "Mpg Files (*.MPG)|*.MPG| ", NULL);
I am forced to repeat: Do you ever read MSDN?Quote:
I use this code to open a CfileDialog for "Save as". And I want to see the ".mpg" files:
CFileDialog cfDlg(FALSE, NULL, m_csPCFileName, OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER, "*.MPG ", NULL);
But I can't see them...
In your case filter could look like:Quote:
........
The lpszFilter parameter is used to determine the type of filename a file must have to be displayed in the file list box. The first string in the string pair describes the filter; the second string indicates the file extension to use. Multiple extensions may be specified using ‘;’ as the delimiter. The string ends with two ‘|’ characters, followed by a NULL character. You can also use a CString object for this parameter.
For example, Microsoft Excel permits users to open files with extensions .XLC (chart) or .XLS (worksheet), among others. The filter for Excel could be written as:
static char BASED_CODE szFilter[] =
"Chart Files (*.xlc)|*.xlc|Worksheet Files (*.xls)|*.xls|Data Files (*.xlc;*.xls)|*.xlc; *.xls|All Files (*.*)|*.*||";
Code:szFilter[] =_T("MPG Files (*.MPG)|*.MPG|All Files (*.*)|*.*||");
... or only:
CFileDialog cfDlg(FALSE, NULL, m_csPCFileName, OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT | OFN_EXPLORER, _T("MPG Files (*.mpg)|*.mpg||") );
There is no need to declare that static variable.
Thank's it works weel...
Sorry fot all these questions. I've one last:
How is it possible to recover the file path from which the application is executed ?
Check out GetModuleFileName API
Thank's for all of the informations you gave me :)
You really helped me.