ShellExecute: Exception 0x80004002

From: Christoph Stoepel (Stoepel_at_discussions.microsoft.com)
Date: 08/10/04


Date: Tue, 10 Aug 2004 09:15:08 -0700

Hi,

i have a strange problem and cannot find a solution (i tried manuals, msdn,
google...).

I want my MFC42 App (still VS6 User for C++) to open a Website in default
browser. Therefore I use

::ShellExecute(AfxGetMainWnd()->GetSafeHwnd(), _T("open"), (LPCTSTR)strURL,
NULL, NULL, SW_SHOWNORMAL);

When I execute it, nothing happens (neither in Debug nor in Release mode).
The Debugger shows the following lines

"C:\WINDOWS\system32\apphelp.dll" wurde geladen. ...
"C:\WINDOWS\system32\shdocvw.dll" wurde geladen. ...
"C:\WINDOWS\system32\actxprxy.dll" wurde geladen. ...
Nicht abgefangene Ausnahme in MyApp.exe (KERNEL32.DLL): 0x80004002: (kein
Name).
Nicht abgefangene Ausnahme in MyApp.exe (KERNEL32.DLL): 0x80004002: (kein
Name).

Which means in in English: DLLs loaded and then first chance exception in
Kernel32.dll.

Strange is:
- When I use the same line in other Apps, it works
- In this special program, ShellExecute returns SE_ERR_ACCESSDENIED
- When I use full path for browser
(HKEY_CLASSES_ROOT\\http\\shell\\open\\command) it works again
 //::ShellExecute(NULL, NULL, strBrowser, strURL, NULL, SW_SHOWNORMAL);

I have no special compiler/linker options set in this program, so why do I
get this Exception? I think somewhere, I get harder security restrictions,
but I dont know how and with what commands.

Here is my init code:

BOOL CMyApp::InitInstance()
{
        InitCommonControls();
        CoInitializeEx(NULL, COINIT_MULTITHREADED);
        AfxEnableControlContainer();
        AfxInitRichEdit();
        Enable3dControls();
...

Hope someone has an idea.
Christoph



Relevant Pages

  • Re: Help! my toolbar cause IE deadlock
    ... I have a strange problem, ... the IE will hang when the one of browsers is ... > 2) Creates some work threads with CWinThread in this DLL ... > 4) In Browser thread, create a hidden window for receive the message ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Very strange: Cannot access any sites although connection apparently good
    ... > I have a very strange problem. ... If I connect via my ADSL modem everything works perfectly. ... > names are resolved but at the last stage the browser fails ... its possible that your netgear router does not handle ECN packets ...
    (Debian-User)
  • Has anyone experienced this unusual problem?
    ... I recently started experiencing a strange problem in Vista. ... Whenever I click on a link for an ad in my browser (clickserve or linksynergy for example) I get a blank page as a result. ...
    (microsoft.public.windows.vista.general)
  • Explorer component
    ... We have encountered a strange problem for out kiosk that was supposed ... We are using our own browser which is basically a .Net ... avoid printer dialogs we are using an ActiveX component that prints ... Using our browser in XPe the page is not printed ...
    (microsoft.public.windowsxp.embedded)

Quantcast