I'm trying to launch a browser window when I click on a dialog button in a vis c++ app. However, the function i'm using only launches if a specific path to a html file is given. I don't know where the user may run the application from so i'm getting the current directory. However, I need to be able to add in the local path to the file and I don't know how to add that path to the current directory I get. Here's what i'm currently doing:
ShellExecute(NULL, "open", currentDirectory, NULL, NULL, SW_SHOWNORMAL);
currentDirectory is an array of TCHARs. I'm wanting to launch from currentDirectory + "/game/index.html".
Any ideas how I can concatenate the local path to currentDirectory?
What type does currentDirectory have to be? Maybe make a small program and work on combining an array of char types with a string literal via strcpy(), and then see if that works with an array of TCHAR's.
It has to be LPTSTR, which is some Microsoft specific format and that's pretty much all I know about it.
Use the function _tcscat().
LPTSTR is defined as either wchar_t* or char* depending on if _UNICODE is defined. If _UNICODE isn't defined, then you could just use strcat(), but it's best to use _tcscat() to handle either case.