Click here to Skip to main content
15,892,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have to implement a packet sniffer GUI. For this, i am using SDI. There should be a list control for showing packet capture. When user enables an option a dialog box should appear. I have some doubts.
1. Is SDI enough for such an application or should i use MDI?
2. How to show the dialog box X, in the bottom of the list control?
Posted

SDI is quite enough. You can stick into it as much as you need, using, say, tabbed interface (recommended). Do yourself a big favor, never use MDI:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^].

What is "dialog box X"? How it can be in the button of list control? A part of list control (which seems impossible) or just directly under? What is the purpose of it?

—SA
 
Share this answer
 
Comments
reshmi2000 7-Jul-11 3:30am    
In "Options" menu, on clicking a menu item "Enable Send", the dialog box should appear. That was what i meant. The dialog box contains a set of data required for sending a packet. This dialog box should be a part of the main view, just below the list control. Is this possible? Also, can it be made resizable? Hope you understand my question.
Sergey Alexandrovich Kryukov 8-Jul-11 1:44am    
A "dialog" means something with modal behavior. If it's a "part of main view", this is not a dialog. You should either have a real modal dialog with all your options (yes will all of them, probably classified in tag pages of a tab control) or it should permanently sit is a main view (hidden or not is a different question; could be hidden by a tab control of any kind of docking panel, of changing page panel, or something). In the second case, there should not be a menu item. What it does? Just visualize a part of main view? No. A main view should be self-navigating. A typical action of the main menu should either run some action/thread, or open some modal dialog, or create an owned window (keep it to minimum or if use at all). Menu is not expected to interfere with main view navigation. (There is an exclusion, main menu item "Windows", but this is nearly archaic. Look how Ctrl+Tab works in Visual Studio 2008-2010 -- this is much better.
--SA
1. SDI should be enough... heck, for a packet sniffer GUI even a simple dialog would should be enough.

2. If you want to embed a window in a control, you'll probably have to dynamically create the window (using Create()) within the control and may have to draw out the control yourself (although you may not have to, depends on the situation). A lot of people seem to think embedding things into controls is impossible (or very hard), but MFC is object oriented, so it's very possible (and not always very hard). You just have to have a good grasp of how things are drawn out and how to define the containing rectangle and override the drawing handlers if need be.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900