Application running from File Memory Map

  • Thread starter Thread starter doanwon
  • Start date Start date
D

doanwon

hello, first post, thanks for reading...

Say I create an MFC Dialog program. I then click on an
"OnCreateButtons" button to create a long list of MFC buttons/objects,
which would then be created--but takes some time. Now this is what I
want: I want to store these instances into file memory map so that I
don't have to create these again each time I run the program. How
should I do it?

Also if possible, how could I save and invoke a complete running MFC
application on a mem map file?

Thanks.
 
doanwon said:
hello, first post, thanks for reading...

Say I create an MFC Dialog program. I then click on an
"OnCreateButtons" button to create a long list of MFC buttons/objects,
which would then be created--but takes some time. Now this is what I
want: I want to store these instances into file memory map so that I
don't have to create these again each time I run the program. How
should I do it?

You can't because they have to associated with structures inside Windows
itself.

How many buttons are you talking about? If some are off-screen, you may
improve responsiveness by creating them only when the user scrolls them into
view.
Also if possible, how could I save and invoke a complete running MFC
application on a mem map file?

You can save and reload en masse any chunk provided:
(1) You don't keep pointers to information outside the chunk (that's why
it will never work for MFC controls)
(2) All your pointers within the chunk are relative or appropriately
adjusted at load time

Whether you use memory-mapped files or standard I/O makes not the least bit
of difference in the data stored and retrieved.
 
Back
Top