Click here to Skip to main content
15,918,742 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: iptypes.h Pin
Member 57135819-Nov-03 21:06
Member 57135819-Nov-03 21:06 
Generallimited dynamic CStatics Pin
halblonious18-Nov-03 9:45
halblonious18-Nov-03 9:45 
GeneralRe: limited dynamic CStatics Pin
Christian Graus18-Nov-03 9:48
protectorChristian Graus18-Nov-03 9:48 
GeneralRe: limited dynamic CStatics Pin
halblonious19-Nov-03 4:15
halblonious19-Nov-03 4:15 
GeneralRe: limited dynamic CStatics Pin
Christian Graus19-Nov-03 10:16
protectorChristian Graus19-Nov-03 10:16 
GeneralRe: limited dynamic CStatics Pin
Peter Molnar19-Nov-03 14:20
Peter Molnar19-Nov-03 14:20 
GeneralRe: limited dynamic CStatics Pin
halblonious20-Nov-03 9:24
halblonious20-Nov-03 9:24 
GeneralRe: limited dynamic CStatics Pin
Peter Molnar20-Nov-03 11:02
Peter Molnar20-Nov-03 11:02 
halblonious wrote:
Wouldn't that use a ton of memory

No, not an issue. You will hardly notice it in the memory footprint of your app.

halblonious wrote:
is there really no way to avoid it?

There are two ways for storing multiple values of the same type (like those of your shapes):
1.List
2.Array

Theoritically both can replace each other, but there are rules of thumbs for their usage:
A list should be preferred if the number of elements is not known, and an array if their number is well known.

The reson for the why lies in the memory management of them (i.e. the way the stored items are organised in memory).
Using a list you can easily (i.e: quickly) access the next or previous element but you can only slowly access the elemnt at a given number from the begining. Arrays can access elements at given position quickly but they are slow if you change their size.
If you allocated 1000 CStatic's in an array and later it turns out that you will need 1001 of them, all the stored data in the 1000 CStatic's must be reordered by the memory management which might go slowly.

In MFC they are called array and list(e.g see CObArray and CObList in MSDN), but in STL (Satandard Template Library - which is Microsoft independent) they are called vector and list.

BTW: ask another question on this forum about your app's design describing what in detail what you want. You will save a bunch of time by not trying to go unachievable ways.

Peter Molnar
QuestionProperty Sheet in a CDialogBar - possible? Pin
srev18-Nov-03 9:34
srev18-Nov-03 9:34 
AnswerRe: Property Sheet in a CDialogBar - possible? Pin
Peter Molnar18-Nov-03 12:53
Peter Molnar18-Nov-03 12:53 
GeneralRe: Property Sheet in a CDialogBar - possible? Pin
srev18-Nov-03 13:47
srev18-Nov-03 13:47 
GeneralFile read Pin
Anonymous18-Nov-03 8:42
Anonymous18-Nov-03 8:42 
GeneralRe: File read Pin
Adam Gritt18-Nov-03 8:50
Adam Gritt18-Nov-03 8:50 
GeneralRe: File read Pin
Christian Graus18-Nov-03 9:49
protectorChristian Graus18-Nov-03 9:49 
GeneralModless Dialog access in Console based applications Pin
parekodi18-Nov-03 8:35
parekodi18-Nov-03 8:35 
GeneralRe: Modless Dialog access in Console based applications Pin
Tim Deveaux18-Nov-03 8:58
Tim Deveaux18-Nov-03 8:58 
GeneralRe: Modless Dialog access in Console based applications Pin
parekodi18-Nov-03 9:33
parekodi18-Nov-03 9:33 
GeneralRe: Modless Dialog access in Console based applications Pin
Tim Deveaux18-Nov-03 9:47
Tim Deveaux18-Nov-03 9:47 
GeneralIP Address Pin
Member 57135818-Nov-03 7:06
Member 57135818-Nov-03 7:06 
GeneralRe: IP Address Pin
David Crow18-Nov-03 7:24
David Crow18-Nov-03 7:24 
GeneralRe: IP Address Pin
Member 57135818-Nov-03 12:03
Member 57135818-Nov-03 12:03 
GeneralRe: IP Address Pin
David Crow18-Nov-03 14:22
David Crow18-Nov-03 14:22 
GeneralRe: IP Address Pin
Member 57135818-Nov-03 19:08
Member 57135818-Nov-03 19:08 
GeneralRe: IP Address Pin
boxban18-Nov-03 16:18
boxban18-Nov-03 16:18 
GeneralRe: IP Address Pin
Member 57135818-Nov-03 19:11
Member 57135818-Nov-03 19:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.