std::string ExtractDirectory( const std::string& path )
{
return path.substr( 0, path.find_last_of( '\\' ) +1 );
}
int main()
{
char buffer2[2048];
char buffer1[5120];
GetModuleFileName(NULL, buffer2, 2048);
std::string dir = ExtractDirectory(std::string(buffer2));
}