I am programming in VC++/MFC to make applications for Bus, Airline and other ticket booking softwares. In those applications i need to display the available Buses/Flights in as in Web pages. i.e., like tables. A row for a flight like that. Currently I am making such a view by creating 16 to 18 static(CStatic) controls for a single flight. I have arranged the statics to be a cell of a row and display the detail(For Eg: Flight No, Departure time etc.,). If the number flights is more than say 100 i have to create nearly 2000 static controls to display the whole list of flights. If it exceeds in number then the creation of controls fails due to unavailable memory(Getting Error: "Out of Memory"). Could any body suggest me an alternative solution to the problem i am facing? Is there any other way of displaying the flights/buses in the same way As i have did?

Why don't you use a grid control for that. There's MSFlexGrid that's installed along with your compiler and is pretty easy to use. You can also get other grid controls such as Ultimate Grid. Then there's a free grid control by Chris Maunder. I've used both FlexGrid and the Chris's grid. Chris's grid will let you edit the cells and you can make the cells normal edit control or combo boxes. Its very feature rich and you get the source code to customize as you wish if you want to.

Dear Mr. Ancient Dragon,
Thank you very much for your reply. But my requirement is not like that of a table of some contents. I should be able to create a row of contents and then leave a space and then the next row. If the flight is connecting then the two rows will be continuous without any space between them. Actually i have done that with the help of CStatic. Using more CStatic objects occupy more space in the memory which ultimately leads to the collapse of application if the number of flights increase.

With Thanks,

This article has been dead for over six months. Start a new discussion instead.