#include #include #include using namespace std; /* ============ GetHL2Path: Gets path from VPROJECT and checks for HL2.exe ============ */ bool GetHL2Path( char *hl2path ) { hl2path = getenv("vproject"); strcat( hl2path, "\\..\\hl2.exe" ); FILE *hl2exe = fopen( hl2path, "r" ); if( !hl2exe ) { return false; } return true; } /* ============ Main: ============ */ int main( char pPath[_MAX_PATH] ) { if( !GetHL2Path( pPath ) ) { cout << "Error: Couldn't get Vproject path!" << endl; exit( 1 ); } //This is the crashy shit, doing anything at all with pPath is killing the app... cout << pPath << endl; return 0; }