ShellExecute(NULL, TEXT("open"), TEXT("report\index.html"), NULL, NULL, SW_SHOWNORMAL);
Above is my line of code and I, for some reason, cannot get the file to open. Below are all the lines I have tried.
ShellExecute(NULL, TEXT("open"), TEXT("report/index.html"), NULL, NULL, SW_SHOWNORMAL);
ShellExecute(NULL, L"open", L"report\index.html", NULL, NULL, SW_SHOWNORMAL);
ShellExecute(NULL, _T("open"), _T("report\index.html"), NULL, NULL, SW_SHOWNORMAL);
Below is list of what I have included.
// Windows Header Files:
#include <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <Shellapi.h>
My file structure is structured out like this:
Downloads/test/program.exe
Downloads/test/report/index.html
This is the first time writing this code and I'm really not sure when to tell when I need to differentiate between "/" and "\". I believe I need to be using TEXT() because when I go to my VS2010 project, Properties > Character Set it says: Use Unicode Character Set. Or at least I believe I have to use TEXT(), I am really not sure.
Also do I need to provide the full path of the file instead of making the assumption it's traveling from where my exe is located? If so is there a quick and easy function call to get the full directory path? Is it just an include file I am missing?