This has worked for me without any errors:
ShellExecute(NULL, _T("open"), _T("C:\\Program Files\\...."), NULL, NULL, SW_SHOW);
The file i am opening here is a PDF file and its working fine. We know ShellExecute will open the file with whatever viewer the PDF file is associated with. But i am having a question,
1.) What if the user doesn't have an associated viewer for the PDF, In this case what would be the default PDF reader the ShellExecute will pick to open the PDF?
2.) What if the user doesn't have any acrobat or PDF reader or PDF viewer installed (he never has anything to open a PDF file)? How do i handle this case?