Application running from File Memory Map

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.
 
B

Ben Voigt

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top