Sign in to follow this  
try_catch_this

GetOpenFileName troubles

Recommended Posts

int C_WinFileHandler::OpenFile( std::string & path, char filter[],
                                char defexten[], const DWORD& flags,
                                const short& filterindex, char title[] )
{
   short buflen = MAX_PATH+1;
   char  buffer[buflen];
   ::ZeroMemory( buffer, buflen );

   OPENFILENAME ofn;
   ::ZeroMemory( &ofn, sizeof(ofn) );

   ofn.lStructSize  = sizeof(ofn);
   ofn.hInstance    = ::GetModuleHandle( NULL );
   ofn.hwndOwner    = ::GetActiveWindow();

   ofn.lpstrFile    = buffer;
   ofn.nMaxFile     = buflen;
   ofn.lpstrTitle   = title;
   ofn.nFilterIndex = filterindex;
   ofn.lpstrDefExt  = defexten;

   ofn.Flags        = flags;
   ofn.lpstrFilter  = filter;

   int iRetValue   = ::GetOpenFileName( &ofn );
   path = buffer;
   m_MulltiSelectFileNames = GetMulltiSelectFileNames( buffer );
   return iRetValue;
}


When I specify OFN_ALLOWMULTISELECT in the flags and try to selects all the files in a directory, the path that this function gives me is "\006\001" when the actuall path is "C:\Dev-C++\projects\TileMapEditor\tiles\tree" any I dea why this would happen?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this