Re: CMap

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Alex wrote:
Hi,

Requirement:
I have to display information in two windows like
First Window Info. : struct{BookId,BookName,TotalPages,TotalNoOfWeeks}
Second Window Info: struct{BookId,BookName,PrintedPages,NoOfWeek}


First window displays the book information. and second window displays current status of that particular book. Whenever user clicks on particular book of first window, second window will display the status of that book from the beginning.

this is not real time example. I just tried to simulate my problem. assume, to complete print one book - 10 weeks.First window will have only one entry per book, and second window will have more than one entry per book.

Now, I want to choose collection classes in this scenario. But, It should be optimal solution.

I am planning to choose CMap<BookId,BookId,CArray,CArray>. Is it correct solution?

The first entry of CArray will be the first window information. sencond entry onwards will be second window information.

If you have optimized solution than this, please share with me.
Thanks in advance.

Alex:

I'm not sure I understand the relationship of your map to the problem you describe, but AFAIK it is not possible to put MFC containers (e.g. CArray) in another container (e.g. CMap). If you use the standard library collection classes (std::vector, std::map) you will not have this problem (and you will not have the confusing double template argument either).

--
David Wilkinson
Visual C++ MVP
.



Relevant Pages

  • Re: What is wrong with WindowsXP CD?
    ... When you boot from the Windows XP setup CD, ... BIOS setup for Legacy USB devices? ... FAIL to strike any key during a few second window of opportunity, ...
    (microsoft.public.windowsxp.general)
  • Re: CMap
    ... Will map with vector give any performance issue? ... First Window Info.: struct ... Second Window Info: struct ... First window displays the book information. ...
    (microsoft.public.vc.mfc)
  • Re: Need help with macro
    ... the IE that is causing a 2nd window to open or an active X is interfering ... "Walter Briscoe" wrote: ... IE.Navigate2 URL opens a second window. ... I needed to get the table starting with the string "Trading ...
    (microsoft.public.excel.programming)
  • Re: Make two windows appear active at the same time
    ... in the second window - and returning MA_NOACTIVATE. ... explicitly set the focus back to the first window. ... The button hides the focus rectangle (because it receives ...
    (microsoft.public.win32.programmer.ui)
  • Re: Calling Java applet function upon browser close
    ... resulting from the fact that the applet is attempting to call a ... Maybe you want to "hide" the second window. ... You may also add a similar observation to the first window, that repeatedly checks if the second window is still open, and if not - reopens it ... ...
    (comp.lang.java.programmer)