CFileDialog and OFN_SHAREAWARE => asserttion error
Posted on 1997-11-27
I want to use the CFileDialog so that a user can choose a file. The file will not be opened now, but rather stored in my inifile. The problem is that I can get a share violation when choosing the file, so I found OFN_SHAREAWARE, which I thought should ignore the error and just return the filename, which is exactly what I want, but when doing DoModal() I get assertion error in MS code.
CFileDialog cfd( true, "tok\0", initialFilename );
cfd.m_ofn.Flags = OFN_SHAREAWARE;
if( cfd.DoModal() == IDOK )
m_filename = cfd.GetPathName( );
UpdateData( false );
How can I solve this one??