Jump to content
  • Advertisement
Sign in to follow this  

GetOpenFileName troubles

This topic is 5057 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 );

   ::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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!