Hi there,

I generated an App Wizard simple Win32 console programme and put the following code into main()...

_asm {
mov AX , 0x10
int 0x10
}

The mode appears to be set but after about a second a blue screen appears reporting a fatal exception.

How do I stop this? (Basically, I'm trying to port some Borland C++ files to VC++)

Thanks,

S.
Posted on 2002-04-13 16:00:21 by Station
Isn't int a DOS command?
Posted on 2002-04-13 16:31:42 by Nordbon
Yes, it is. But it still works at first so why would this be a problem?

The original file uses 'geninterrupt(0x10)' but I think this only works with Borland.

Cheers,

S.
Posted on 2002-04-13 16:36:18 by Station
hi station

As far as I know a win32 app cannot acces dos interups. A console app is the same it just has a console allocated to it. Programs run in a dos box that access interupts are probably native dos executables.
Posted on 2002-04-13 18:57:41 by Kudos
I've gotten other modes to work... but I doubt that 0x10 (10h = 640x350/ega) would work in a dos box... try 0x04 (mov ax,0x0004) and work your way up from there ;)
Posted on 2002-04-14 01:32:45 by SpooK
Thanks for the response.

What is special about mode 10h which would make you doubt that it would work in a dos box?

When code which sets VGA to mode 10h using 'int' is compiled to native dos using a pre-Masm32 version of Masm, the executable works fine from Windows. Wouldn't this be running in a 'dos box'?


Surely its possible to set mode 10h from a Windows program! If not, is it possible to create a dos program using VC++ 6?

Cheers,

S.
Posted on 2002-04-14 09:11:07 by Station
Station, you program WIN32 using the win32 API... this means
GDI or DirectDraw for 2D graphics. I doubt you will be able to switch
modes by calling dos interrupts (unless you use DPMI services, but
this is only available in win9x and is somewhat of a hack).
It puzzles me that you get a BSOD though, you only ought to get
a general protection fault.

As for console win32 apps... the only thing they have in common
with a dos app is that they're textmode - you can NOT access the
dos subsystem, you run protected mode, use the win32 subsystem,
et cetera.
Posted on 2002-04-14 11:41:34 by f0dder