|
|
Thanks, I should've tried that before posting, but didn't want to mess with the existing source too heavily. I'll give that a try. Thanks again.
|
|
|
|
|
Hi All
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)
Please help me.
Thanks
|
|
|
|
|
You can't run a dialog-based application without Windows. What you're asking can only be done with a generic DOS application that doesn't use Windows at all.
Ryan "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"
|
|
|
|
|
Thanks
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.
|
|
|
|
|
If ur using Windows 98, u can put the exe name in the file AUTOEXEC.BAT. this is an hidden file located in "c:" . The os will execute that batch file during start up.
In the case of XP i think u should have to run it as some services
nave
|
|
|
|
|
I want to create startup disk for application and wnt that this disk will run the application before Widows OS loading.
So role of OS should be there.
Please guide me.
Thanks
|
|
|
|
|
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)
nave
|
|
|
|
|
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).
Ryan "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
|
|
|
|
|
followait wrote: Is there a function like OnInitDialog for CScrollView?
OnInitialUpdate()
Ryan "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"
|
|
|
|
|
It isn't called when it isn't in the doc-view frame.
|
|
|
|
|
So where is your view then?
Ryan "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"
|
|
|
|
|
followait wrote: It isn't called when it isn't in the doc-view frame.
It isn't called because you haven't attached the view to a document. OnInitialUpdate is called after a view is first attached to a document.
These view classes are specifically meant for document view architecture.
Nibu thomas
Software Developer
|
|
|
|
|
NOTIFYICONDATA nidData;<br />
HICON hIcon = LoadImage(...IMAGE_ICON...LR_LOADFROMFILE)<br />
if (hIcon)<br />
{<br />
nidData.hIcon = hIcon;<br />
Shell_NotifyIcon(dwMessage, &nidData);<br />
DestroyIcon(hIcon); // now can Destroy the icon? but the icon Destroy, the tray how to get the icon ?
}
|
|
|
|
|
I don't think you should be calling DestroyIcon - If you do the shell will be holding onto an invalid handle.
Steve
|
|
|
|
|
but icon not Destroy, happed leak.
now not happen something 
|
|
|
|
|
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... 
|
|
|
|
|
Thank you very much. I only wish my code is strong and safe, and this is good custom.
|
|
|
|
|
HOW WHAT wrote: DestroyIcon(hIcon); // now can Destroy the icon? but the icon Destroy, the tray how to get the icon ?
What happens after you do that? Does the Icon get displayed in the tray.
Nibu thomas
Software Developer
|
|
|
|
|
As of now, not happen something, the icon dispalyed in the tray.
|
|
|
|
|
Take a look at the remarks section of this topic:
Click Here[^]
Nibu thomas
Software Developer
|
|
|
|
|
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
Bitmap DeleteObject
Cursor DestroyCursor
Icon DestroyIcon
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.
|
|
|
|
|
So what do you think now?
Nibu thomas
Software Developer
|
|
|
|
|
Does anyone know how to instantiate an array in a __gc structure?
e.g
__gc struct epdata
{
__int61 count;
__int64 val __gc[]; // an array of integers
} x;
The compiler won't allow the array to be sized such as
__int64 val __gc[10]; // an array of integers
it gives this error message
e:\xf\Form1.h(12): error C3616: '10': a size cannot be specified in a __gc array declaration
This question came up when attempting to read data from the array that had been stored in the array previously.
e.g
x->val[0] = 2; // no error is generated on this line
__int64 y = x->val[0]; // this line gives " Object reference not set to an instance of an object."
|
|
|
|