Link to home
Start Free TrialLog in
Avatar of chikersal
chikersal

asked on

doc view

Sir,
      I have heard a lot about document view architecture. Infact right now i am working on a project which uses document view architecture. Since we are creating front end which queries the database which is stored in flat files, it makes sense that we use document view architecture. Reason being it automates almost all the operations pertaining to files ( it encapsulates streams, automates the opening of common dialog boxes and all that). Now my question is that when we make other application in vc/mfc where we dont use flat files to store the data, where infact we are using a database, i dont think so we need to use this architecture. But many programers differ from me. U see if u use vc++ app wizard to generate database application it uses the same doc view architecture which to me does not make any sense. So do u think doc view is widely acceptable for writting all types of vc++ applications especialy those which do not use flat files. Cant we write a great mf application without using doc view architecture.

Sir, my another question is that when we create a menu two things happen with regard to a menuitem. When we move mouse over a menuitem the item gets highlited. Its only when we actually click on the menuitem that it generates a WM_COMMAND message. Actually what i want is that when my menuitem gets highlighted, does it generate any message so that moment it gets highlited i should be able to display in a status bar below what is the purpose of this menuitem instead of the user pressing F1 to popup context help to lnow about that item

ASKER CERTIFIED SOLUTION
Avatar of peterchen092700
peterchen092700

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of peterchen092700
peterchen092700

btw. you have quite a lot of questions still open, some of them from last year! Grading them is the least you can do in return for our support.

Cheers
Peter
Avatar of chikersal

ASKER

2. There is no message sent. MFC framework updates the status bar in it's OnIdle handler. The info in
the status bar is available faster and less obstrusive than Context sensitive help. It is displayed
as well when the mouse hovers over a toolbar button with the same id.

The text is defined when you enter the "prompt" for the commands (<short_text>\n<long text>), where
short_text is used for the toolbar QuickInfo, and long_text for the status bar.




but sir, when does the framework call OnIdle handler. And secondly when i create menu i define my own resource file where i use this statement

MyMenu MENU
{
  POPUP "&Options"
  {
   MENUITEM "&Cut",IDM_CUT
   MENUITEM "Co&py",IDM_COPY
   MENUITEM "pa&ste",IDM_PASTE
  }
}

where here should i give the propmpt value
so do u agree with me that document view architecture does not contribute much when creting database application whcih uses databse rathr then flat disk files. Am i right?
>> so do u agree with me that document view architecture does not contribute much when creting database application whcih uses databse rathr then flat disk files. Am i right?

Depends on the interface your application should have. You can very quickly generate an MFC applic<aation that has a form for each record of one table/query of the DB, where you can navigate with usual "head/prev/nex/end" buttons. You can have a list of records of one query relatively easy.

However, If your UI should look far different, like  a tree navigating through different tables, or heavy interdependency of the records, I would chop Doc/View, because it won't help you anymore and you will soon start disabling Doc/View features because they are in your way.


>> when does the framework call OnIdle handler
Any time there is no input in the queue. CWinApp::OnIdle is called as long as it indicates it needs to process further. If you e.g. kick your mouse, these messages areprocessed, and when they are done, OnIdle will get called.

>> where here should i give the propmpt value
If you prefer to edit your .rc file manually, add an item with the same ID to the string resources.

Peter




u say its called when there is no inpout int the queue but i want to display the meaning of the menuitem the moment item gets highlited. so pls write the code as i have not understood what u r trying to say
 and if ever to use OnIdle for that purpose what code should i write in CWinApp::OnIdle() so as to show in the status bar what does a particular menuitem mean
>>so pls write the code
What kind of application do you have? In an MFC aplication, this is done automatically, only you have to provide the strings to be displayed.

If you don't understand things like "Message Queue is empty", i strongly recommend a good introductory book, like Petzold's "Windows Programming"

Cheers, Peter
i very well know what is a message ques but somehow i could not understand the way u told me
so I'll try again ;)
After processing any message, the Main Message Loop checks the input queue using PeekMessage, and if there is no message pending, it calls OnIdle. (it's a bit more complex than that)

MFC takes care of displaying the description of the current menu selection in the status bar. If you move the mouse, or press a key, these are processed, qand then, OnIdle is called. The default implementation takes the Command ID of the currently selected menu item, and looks in the resources if there is a string with the same ID. If yes, this one is taken to display the description.

Are you writing an MFC application? If yes, MDI, SDI or Dialog based? If no, what library are you using?


Peter
chikersal,

You have a large number of questions have been open for some time, and our records show you logged in as recently as today. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days.

https://www.experts-exchange.com/jsp/qShow.jsp?qid=11443178
https://www.experts-exchange.com/jsp/qShow.jsp?qid=11964778
https://www.experts-exchange.com/jsp/qShow.jsp?qid=12043279
https://www.experts-exchange.com/jsp/qShow.jsp?qid=11564958
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20104338
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20104344
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20105195
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20107021
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20117736
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20123376
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20128779
https://www.experts-exchange.com/jsp/qShow.jsp?qid=11146525
https://www.experts-exchange.com/jsp/qShow.jsp?qid=11559878
https://www.experts-exchange.com/jsp/qShow.jsp?qid=11540439
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20158555
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20174325
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20176309
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20177269
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20183746
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20184309
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20188568
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20260766
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20260773
https://www.experts-exchange.com/jsp/qShow.jsp?qid=20262003

Thanks,

Netminder
Community Support Moderator
Experts Exchange
Force/accepted by

Netminder
Community Support Moderator
Experts Exchange