Displaying message/dialog box before EnableShellOpen call 
Author Message
 Displaying message/dialog box before EnableShellOpen call

I have an MDI application. If I display a message box or
dialog box before EnableShellOpen call in InitInstance and
double-click on a file associated with my application, the
application does come up as well as the message box.
However, an error message also comes up complaining that
my file (on which I double-clicked) was not found. That
message is followed by another message that the object
referred to by that file has been removed or is
inaccessible. The file I double-clicked is not opened.

These errors messages DO NOT come up if I display message
box or dialog box AFTER EnableShellOpen call. Does this
mean one cannot display a message box or dialog box before
calling EnableShellOpen?

Do I need to make certain changes in registry so that I
may display message boxes before calling EnableShellOpen?



Wed, 16 Nov 2005 03:05:11 GMT  
 Displaying message/dialog box before EnableShellOpen call

Quote:
>These errors messages DO NOT come up if I display message
>box or dialog box AFTER EnableShellOpen call. Does this
>mean one cannot display a message box or dialog box before
>calling EnableShellOpen?

The obvious answer is yes - if it hurts, don't do it!

Quote:
>Do I need to make certain changes in registry so that I
>may display message boxes before calling EnableShellOpen?

Why not just change your code to do those operations after calling
EnableShellOpen. It's usually preferable to go with the flow rather
than fight it.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Wed, 16 Nov 2005 09:33:43 GMT  
 Displaying message/dialog box before EnableShellOpen call

I agree. However, I havnt seen anything in MFC
documentation that you cant display message boxes, or any
window for that matter, before calling EnableShellOpen.
So, I was not sure if there was something that I was doing
wrong or it's something that one cant do at all.

It appears from your response that one should generally
avoid displaying message boxes before calling
EnableShellOpen.

Quote:
>-----Original Message-----
>>These errors messages DO NOT come up if I display
message
>>box or dialog box AFTER EnableShellOpen call. Does this
>>mean one cannot display a message box or dialog box
before
>>calling EnableShellOpen?

>The obvious answer is yes - if it hurts, don't do it!

>>Do I need to make certain changes in registry so that I
>>may display message boxes before calling EnableShellOpen?

>Why not just change your code to do those operations
after calling
>EnableShellOpen. It's usually preferable to go with the
flow rather
>than fight it.

>Dave
>--
>MVP VC++ FAQ: http://www.mvps.org/vcfaq
>.



Wed, 16 Nov 2005 22:50:28 GMT  
 Displaying message/dialog box before EnableShellOpen call

Quote:
>I agree. However, I havnt seen anything in MFC
>documentation that you cant display message boxes, or any
>window for that matter, before calling EnableShellOpen.

I'm not aware of anything specifically saying that either.

Quote:
>It appears from your response that one should generally
>avoid displaying message boxes before calling
>EnableShellOpen.

My response was just a suggestion that it's better to avoid the
problem rather than fight it. It's not a situation I've hit myself, so
I don't know precisely what's happening.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Thu, 17 Nov 2005 00:24:42 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. PBM: Message box not displayed after main dialog box is closed in MFC dialog-based app

2. Post message from modal dialog to modeless dialog box....urgent!!!!!!!!!!!!!!1

3. Displaying a Message Box

4. Displaying a message box?

5. Displaying a message box

6. displaying integers in message box

7. Display Message Box after OnInitDialog

8. The problem of displaying message box in the handler of killfocus

9. CDC::EndPage failure displays message box

10. List box: displaying the multiple line messages?

11. Which message is automatically called after dialog box is displayed ?

12. Help wanted for windows dialog boxes display

 

 
Powered by phpBB® Forum Software