I am having a problem, will explain with the help of example
Let an dialog based MFC Application for performing some arithmetic operations, now I want to make a startup disk for this application so that if system is switched on or reboot with this disk then instead of windows this application shoul load and run, and after exit of this application Windows OS should be loaded as usual.
I think problem would be clear.( if not then please ask I would try to make it more clear)
OK then I will make a DOS based application and then pls suggest me to create startup disk for that application and how to load that apllication on booting and when exit from application system work as usually.
i will give u a suggestion. i don't know whether it will work or not.
Create a windows startup disk. Edit the Autoexec.bat file in the disk and insert ur application name. In the line after ur exe's name type "win.com"( this executable loads the windows(98).( i don't know what in the case of XP. some time it may work in xp too)
So format a floppy as a system disk (format /s from the command line) using a Windows 98 system, and put an autoexec.bat file on the disk that runs your program.
To automatically restart Windows afterwards, it gets a little complex. When your computer starts, BIOS loads the first sector of the hard disk into memory, then executes it. You could try doing the same. I'd recommend finding some information that shows the complete booting process, as I can't remember it all and don't know of any good resources. Have a look around on the net (google is your friend).
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late"John Nichol "Point Of Impact"
I want to initialize a memory dc, and draw on it in CScrollView::OnDraw.
Is there a function like OnInitDialog for CScrollView?
And I doesn't use CScrollView in the doc-view frame, I only derived from it.
-- modified at 21:34 Sunday 26th February, 2006
Well, destroy it when your window is destroyed (WM_DESTROY handler). There can be no leak of memory associated with the icon this way UNLESS your application is terminated ungracefully, and even then most probably Windows will perform the necessary cleanup.
Not to say that a leak of several kilobytes isn't much of a problem compared to what gigabytes of software out there manage to leak...
When you are finished using a bitmap, cursor, or icon you loaded without specifying the LR_SHARED flag, you can release its associated memory by calling one of the functions in the following table.
Resource Release function
The system automatically deletes these resources when the process that created them terminates, however, calling the appropriate function saves memory and decreases the size of the process's working set.