CoderSource.net
Search
Re: ON_COMMAND_UPDATE_UI
Started by Buck at 11-04-2005 4:24 PM. Topic has 1 replies.

Print Search « Previous Thread Next Thread »
   11-04-2005, 4:24 PM
Buck is not online. Last active: 10/21/2005 6:20:29 PM Buck

Top 25 Posts
Joined on 10-14-2005
Posts 2
Sad [:(] ON_COMMAND_UPDATE_UI

This is simple enough but I'm having a heck of a time implementing it.  I'm using Visual C++ 6.0 and have some menus that I want to keep diabled until I open a file, but I can't figure out how to check to see if the file is open.  GetStatus() doesn't work (nor should it) and a number of other functions that I was hoping would return a boolean depending on the status of the file didn't either.  I have also tried some functions in the CDocument class to no avail.  I know this is a slam dunk so could someone let me in on it?

Buck


   Report 
   11-05-2005, 1:54 AM
admin is not online. Last active: 9/20/2008 12:10:49 AM admin

Top 10 Posts
Joined on 06-18-2005
Posts 17
Re: ON_COMMAND_UPDATE_UI
I am not sure what classes u r using to open/read the files. But in case if your file related classes do not help, why don't u keep a boolean variable and set it when u open the file.

U can then enable/disable the menu depending on the boolean value. For ex. like the following.

    if(x == 0)
        pCmdUI->Enable(TRUE);
    else
        pCmdUI->Enable(FALSE);

If ur problem is just checking the status of the file, can u share the class u r using the for the file operations? Also just paste the code snippet u r using..

HTH
Muthu

   Report 
Codersource.Net » Programming » C++ Programming » Re: ON_COMMAND_UPDATE_UI

MENU
Home
MFC 
C++
.Net
WIN32
Programming
Forum
My Articles
Welcome to Codersource.Net Login | Register | Faq  

Google
 

NOTES:


Thanks for visiting our CoderSource.net. This site will be improved with more articles. Interested visitors can also submit their articles through the Submit Article link.Your article will also be published after due consideration by the editor. 

© Copyright 2003. All rights on content reserved by CoderSource.net. Contact    About Us