|
It is ExitInstance() function.
Thanks,
Suman
|
|
|
|
|
Its seems you know the answer when posted the question (only 4 min difference)
|
|
|
|
|
Rajkumar R wrote: Its seems you know the answer when posted the question (only 4 min difference)
Hi, not like that, after I have posted question, I was searching index help in vc++ IDE, got the function in "members" link. I might have saw it before posting it. I thought of deleting the question, but it may be useful for some other user, or atleast I will not ask it again.
Thanks for your comment.
Best Regards,
Suman
|
|
|
|
|
I'm sorry to post this question twice! But I realy need it...
My question is how can I change writing direction in an edit box in
RUN-TIME? (Right/Left Alignment)
|
|
|
|
|
See here.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Usef Marzbani wrote: I'm sorry to post this question twice! But I realy need it...
But you already got it.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: But you already got it.
Maybe he can't understand your reply because you wrote it Left to Right.
led mike
|
|
|
|
|
i need to create a function that can stop a process which takes long time.
i mean the user can stop the process while it is processing(just like a cancel buton). can i do this by using "backgroung worker"? i found some example code and information in C# but i couldnt in C++.
do i have to use multithreading?
|
|
|
|
|
strictly speaking you don't have to. but the alternatives can be pretty ugly, and even more trouble than using a worker thread.
use a worker thread.
|
|
|
|
|
Well unless your code is doing the processing you can't stop it without terminating the worker thread waiting on the process, which is not recommended.
led mike
|
|
|
|
|
Hi all,
How can I delete some lines in the file using CFile?
Many thanks for your help
|
|
|
|
|
1. create a temp file
2. while (! end-of-file)
3. read line
4. if line is not the one you want to delete
5. write line to your temp file
6. loop to 2
7. copy temp file over your source file
|
|
|
|
|
Thanks
I wonder if there is a method or function directly doing it.
Many thnaks for your answer
|
|
|
|
|
specialhaha wrote: I wonder if there is a method or function directly doing it.
No. You can't remove things from a file, only add things.
|
|
|
|
|
Oh yes, pack Chris code in a function and call it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
|
Hi all,
I've got this piece of code that just won't compile under VC++ 6.0:
__asm {
mov ax, 0040h
mov ds, ax
mov w.[0072h], 0000h
jmp 0FFFFh:0000h
};
The three errors I get are error C2415: improper operand type , error C2400: inline assembler syntax error in 'second operand'; found ':' , and error C2400: inline assembler syntax error in 'opcode'; found ':' . The first two all point to the jmp instruction, but I don't see how it's messed up.
I'm not surprised if there's an obvious error in there; I hardly ever work with asm.
Thanks in advance, and please don't point out that it's a bad idea to do this. I realize that, and the code above is only executed in emergency circumstances.
|
|
|
|
|
Why do you want to execute instructions which will reboot the computer? This will not even execute in usermode on a modern OS such as XP/Vista.
-David Delaune
|
|
|
|
|
Why not? Even if it doesn't work, it should compile at least, right?
modified on Monday, March 17, 2008 3:26 PM
|
|
|
|
|
Not with the syntax your using and addressing.
Try:
__asm
{
mov eax, 0040h
mov ds, WORD PTR [eax]
mov WORD PTR ds:0x72, 0x1234
mov eax,0xFFFF0000
jmp eax
}
As I stated previously... this code does not work in protected mode. So you should be testing this on *nix or DOS based systems. However if you want to accomplish the same in Windows you can use the following function as long as you have the correct privileges.
ExitWindowsEx(EWX_POWEROFF|EWX_FORCE, 0xFFFF);
|
|
|
|
|
Thanks for the advice.
The problem that comes up with ExitWindowsEx is that I have to make sure my application closes last. Which, unless I'm mistaken, isn't possible? And ExitWindowsEx goes through the normal shutdown process. What I'm trying to do is to completely STOP everything.
Thanks for all your help.
|
|
|
|
|
hxhl95 wrote: What I'm trying to do is to completely STOP everything.
Microsoft Windows is not designed to shutdown instantly. There are things which need to be cleaned up like disk cache and virtual memory. In fact even if you wrote a device driver which executed the instructions I have written in the prior threads and managed to initiate an instant cold/warm reboot; You would have a probability of file corruption which may or may not include the registry. In fact, you would also have a high risk of disk corruption on non-journaling file systems and a small risk on journaling file systems. There are manyb things that are happening 'under the hood' when you shutdown Microsoft Windows.
Some questions:
1.) Why dows your application need to be the last to exit.
2.) Do you need your application to be the last 'user' application to exit?
Best Wishes,
-David Delaune
|
|
|
|
|
So it's not possible to shutdown instantly. Is there any faster way to shutdown other than the normal "click the shutdown button" routine?
Answers to your 2 questions: 1.) Cleanup, 2.) Yep.
|
|
|
|
|
hxhl95 wrote: Is there any faster way to shutdown other than the normal "click the shutdown button" routine?
There are no methods which are faster and equally as graceful than the standard shutdown/reboot functions.
Best Wishes,
-David Delaune
|
|
|
|