Open HTML file in browser using C++

c++, html, visual-studio-2010

Solution

#include <windows.h>

void main()
{  
   ShellExecute(NULL, "open", "http://dreamincode.net",
                NULL, NULL, SW_SHOWNORMAL);
}

http://www.dreamincode.net/code/snippet357.htm You would simply replace the above URL shown in the code with the absolute path of your html file. It could be done with variables of course.

Problem

I am writing a program in C++ using Visual studio, what I need to do is create an HTML file and write data in it, and then I wish to get it opened in the browser. Right now I can create file, write stuff but I cannot open it, can anyone help? It maybe an easy question, but I am just a beginner.

Original source