Click here to Skip to main content
       

C / C++ / MFC

 
AnswerRe: Is there a reason you would initialise variables like this? PinmemberMalli_S25-Jul-12 21:58 
QuestionShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11124-Jul-12 8:31 
QuestionRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberDavidCrow24-Jul-12 9:06 
AnswerRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11124-Jul-12 9:13 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pinmemberenhzflep24-Jul-12 9:28 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11124-Jul-12 9:51 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pinmemberenhzflep24-Jul-12 10:07 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11124-Jul-12 10:45 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pinmemberenhzflep24-Jul-12 10:58 
AnswerRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberTopCoder2324-Jul-12 11:04 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmvpRichard MacCutchan24-Jul-12 12:09 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberTopCoder2325-Jul-12 0:37 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11125-Jul-12 6:31 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 [modified] PinmemberTopCoder2325-Jul-12 7:49 
The code below works and launches a helpfile in Windws 7.
 

#include <Windows.h>
#include <tchar.h>
#include <iostream.h>
 
int main()
{ 
 
	  SHELLEXECUTEINFO sei = {0};
      sei.cbSize = sizeof(SHELLEXECUTEINFO);
      sei.lpVerb = _T("open");
      sei.lpFile = _T("C:\\windows\\help.CHM");
      sei.fMask = SEE_MASK_INVOKEIDLIST;
      sei.nShow = SW_SHOWDEFAULT;
 
	  DWORD exitCode;
      int RetVal = GetExitCodeProcess(sei.hProcess, &exitCode);
      cout<<"Errorcode "<<RetVal<<" \n";
 

      // Open up the open as window
      if (ShellExecuteEx(&sei) == FALSE)
      {
 
		switch(RetVal)
		{
			case ERROR_FILE_NOT_FOUND:
			//AfxMessageBox("The specified file was not found.");
			break;
 
			case ERROR_PATH_NOT_FOUND:
			//AfxMessageBox("The specified path was not found.");
			break;
 
			case ERROR_ACCESS_DENIED:
			//AfxMessageBox("Access to the specified file is denied.");
			break;
		}
		
        return FALSE;
      }
 
	 
	return 0;
}


modified 25-Jul-12 13:42pm.

GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11125-Jul-12 10:51 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11125-Jul-12 11:28 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberCharles Oppermann25-Jul-12 8:23 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11125-Jul-12 10:55 
SuggestionRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberCharles Oppermann26-Jul-12 4:39 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11126-Jul-12 5:35 
SuggestionRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberCharles Oppermann26-Jul-12 7:04 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11126-Jul-12 7:56 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberAndraw11126-Jul-12 6:54 
SuggestionRe: ShellExecute() launch .CHM and PDF file not work in Window 7 PinmemberCharles Oppermann25-Jul-12 7:59 
QuestionHow to test firewire communication using C program ? PinmemberCode_Demon_198524-Jul-12 5:58 
GeneralRe: How to test firewire communication using C program ? PinmvpCPallini24-Jul-12 7:35 
QuestionHow to Undo drawing a line in MFC.? Pinmembermbatra3124-Jul-12 2:02 
AnswerRe: How to Undo drawing a line in MFC.? PinmemberEugen Podsypalnikov24-Jul-12 4:14 
AnswerRe: How to Undo drawing a line in MFC.? PinmemberAlan Balkany24-Jul-12 5:02 
GeneralSDI application with 3 views [SOLVED] [modified] Pinmemberekinnh23-Jul-12 23:23 
GeneralRe: SDI application with 3 views PinmemberEugen Podsypalnikov24-Jul-12 1:06 
GeneralRe: SDI application with 3 views PinmemberEugen Podsypalnikov24-Jul-12 1:17 
GeneralRe: SDI application with 3 views PinmemberMohibur Rashid25-Jul-12 15:45 
GeneralRe: SDI application with 3 views PinmemberVaclav_Sal25-Jul-12 17:51 
GeneralRe: SDI application with 3 views Pinmemberekinnh26-Jul-12 19:13 
GeneralRe: SDI application with 3 views PinmemberVaclav_Sal27-Jul-12 3:42 
GeneralRe: SDI application with 3 views Pinmemberekinnh31-Jul-12 23:13 
GeneralRe: SDI application with 3 views Pinmembersunilkpv26-Jul-12 3:09 
Question[Hook HW interrupts in flat mode with DOS32/A] Pinmemberliaoo23-Jul-12 17:42 
AnswerRe: [Hook HW interrupts in flat mode with DOS32/A] Pinmemberenhzflep23-Jul-12 20:01 
GeneralRe: [Hook HW interrupts in flat mode with DOS32/A] Pinmemberliaoo23-Jul-12 20:47 
GeneralRe: [Hook HW interrupts in flat mode with DOS32/A] Pinmemberenhzflep23-Jul-12 21:23 
GeneralRe: [Hook HW interrupts in flat mode with DOS32/A] Pinmemberliaoo23-Jul-12 23:02 
AnswerRe: [Hook HW interrupts in flat mode with DOS32/A] PinmemberTopCoder2323-Jul-12 21:10 
GeneralRe: [Hook HW interrupts in flat mode with DOS32/A] Pinmemberliaoo23-Jul-12 23:05 
QuestionMSDN 2010, scanf_s Pinmembermrby12323-Jul-12 8:13 
AnswerRe: MSDN 2010, scanf_s PinmemberAlbert Holguin23-Jul-12 8:26 
AnswerRe: MSDN 2010, scanf_s PinmvpCPallini23-Jul-12 23:12 
GeneralProgrammatically setting power manager suspend timeouts in Windows CE5.0 [SOLVED] [modified] PinmemberSidProgrammer22-Jul-12 22:21 
GeneralRe: Programmatically setting power manager suspend timeouts in Windows CE5.0 PinmvpRichard MacCutchan22-Jul-12 22:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 23 Nov 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid