Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to reboot my PC with dev-cpp

Status
Not open for further replies.

Techie64

Technical User
Mar 22, 2005
29
0
0
US
#include <dos.h>
void main()

{
union REGS inr, out;
int86(0x19, &inr,&outr);
}

When I compile, it errors at union REGS inr, outr, saying "aggregate 'REGS inr' has".

Am I missing something? Also, what different parameters are available for int86? I'd like to logoff or shutdown the system as well and wonder if different parameters will do this. For example, I've seen 25 as an int86 parameter. It reboots the machine, but I don't know the difference between it and 0x19. Any ideas?
 
25 is 0x19.

Why not use the ExitWindowsEx() function to Logoff, Reboot or Shutdown? It would be much safer...
 
> When I compile, it errors at union REGS inr, outr,
1. Code like that is for jurassic compilers and operating systems. Modern code for modern operating systems don't deal with that kind of stuff anymore.
2. main returns an int, as dev-c++ would no doubt have complained about.
3. Win2K and XP possess a command line command called (not surprisingly) Shutdown

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top