Jump to content
  • Advertisement
Sign in to follow this  
try_catch_this

GetOpenFileName troubles

This topic is 5146 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 );

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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!