Click here to Skip to main content
15,888,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11124-Jul-12 8:51
Andraw11124-Jul-12 8:51 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
enhzflep24-Jul-12 9:07
enhzflep24-Jul-12 9:07 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11124-Jul-12 9:45
Andraw11124-Jul-12 9:45 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
enhzflep24-Jul-12 9:58
enhzflep24-Jul-12 9:58 
AnswerRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Software_Developer24-Jul-12 10:04
Software_Developer24-Jul-12 10:04 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Richard MacCutchan24-Jul-12 11:09
mveRichard MacCutchan24-Jul-12 11:09 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Software_Developer24-Jul-12 23:37
Software_Developer24-Jul-12 23:37 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11125-Jul-12 5:31
Andraw11125-Jul-12 5:31 
Now we have another small project also created in C++, it also launch .CHM file from help menu:

void CMainFrame::LaunchHelp(CString FilePath)
{
SHELLEXECUTEINFO sei;
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.fMask = NULL;
sei.hwnd = NULL;
sei.lpVerb = "open";
sei.lpFile = FilePath;
sei.lpParameters= NULL;
sei.nShow = SW_SHOWMAXIMIZED;
sei.hInstApp = NULL;
sei.lpIDList = NULL;
sei.lpClass = NULL;
sei.hkeyClass = NULL;
sei.dwHotKey = NULL;
sei.hIcon = NULL;
sei.hProcess = NULL;
sei.lpDirectory = NULL;
int ReturnCode = ::ShellExecuteEx(&sei);

switch(ReturnCode)
{
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;
}
}

I works fine in Window 7, I copy this function to my application (also created in C++), but after compile and test it in Window 7, still doesn't work, do we need change some settings to make app work in Window 7?

I compare the settings, the only difference are that
1: in C++ - >Code Generation -> Use run time library: I use Multithreaded DLL, they use Multlhreaded;
2: in General Microsoft Foundation Classes: I use Use MFC in a Shared Library; they use Use MFC in a Static Library.

Thanks!
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Software_Developer25-Jul-12 6:49
Software_Developer25-Jul-12 6:49 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11125-Jul-12 9:51
Andraw11125-Jul-12 9:51 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11125-Jul-12 10:28
Andraw11125-Jul-12 10:28 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Charles Oppermann25-Jul-12 7:23
Charles Oppermann25-Jul-12 7:23 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11125-Jul-12 9:55
Andraw11125-Jul-12 9:55 
SuggestionRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Charles Oppermann26-Jul-12 3:39
Charles Oppermann26-Jul-12 3:39 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11126-Jul-12 4:35
Andraw11126-Jul-12 4:35 
SuggestionRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Charles Oppermann26-Jul-12 6:04
Charles Oppermann26-Jul-12 6:04 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11126-Jul-12 6:56
Andraw11126-Jul-12 6:56 
GeneralRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Andraw11126-Jul-12 5:54
Andraw11126-Jul-12 5:54 
SuggestionRe: ShellExecute() launch .CHM and PDF file not work in Window 7 Pin
Charles Oppermann25-Jul-12 6:59
Charles Oppermann25-Jul-12 6:59 
QuestionHow to test firewire communication using C program ? Pin
Code_Demon_198524-Jul-12 4:58
Code_Demon_198524-Jul-12 4:58 
GeneralRe: How to test firewire communication using C program ? Pin
CPallini24-Jul-12 6:35
mveCPallini24-Jul-12 6:35 
QuestionHow to Undo drawing a line in MFC.? Pin
mbatra3124-Jul-12 1:02
mbatra3124-Jul-12 1:02 
AnswerRe: How to Undo drawing a line in MFC.? Pin
Eugen Podsypalnikov24-Jul-12 3:14
Eugen Podsypalnikov24-Jul-12 3:14 
AnswerRe: How to Undo drawing a line in MFC.? Pin
Alan Balkany24-Jul-12 4:02
Alan Balkany24-Jul-12 4:02 
GeneralSDI application with 3 views [SOLVED] Pin
ekinnh23-Jul-12 22:23
ekinnh23-Jul-12 22:23 

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

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