Mouse Programming difficulties on WINXP
Mouse Programming difficulties on WINXP
I wrote a simple QB code that uses interrupt h33 (mouse) in it.
It works fine in win98se (the pointer show up and moves around), but in winxp, the mouse did not get detected (returning 1 on outregs.ax, instead of -1) when activated using inregs.ax=0. Did I did something wrong or perhaps I need a special driver/lib to get it work?
It works fine in win98se (the pointer show up and moves around), but in winxp, the mouse did not get detected (returning 1 on outregs.ax, instead of -1) when activated using inregs.ax=0. Did I did something wrong or perhaps I need a special driver/lib to get it work?
One defeated only when one stopped wanting to win
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
EDIT: Sorry, didn't read your post right.
If your mouse isn't getting detected, it's because you're running in a DOS window instead of PURE DOS. Either:
a. Remove your WINDOWS XP Mouse Drivers each time you want to run your program and load up DOS mouse drivers (available for download in downloads.). (not reccommended)
OR
b. Run in PURE DOS by holding F5 on Windows Startup and choosing Command Prompt. You will probably need an XMS or EMS manager to run QBASIC. (Use DOS mouse drivers, available for download in downloads.)
This left for reference.
-------------------------
Not sure how much of a fix this would be, but you could use the ABS function to use only positive values, which would make WINXP and WIN98 correct, although this will require recoding in your program.
All values will become positive, hence ABSolute value
If your mouse isn't getting detected, it's because you're running in a DOS window instead of PURE DOS. Either:
a. Remove your WINDOWS XP Mouse Drivers each time you want to run your program and load up DOS mouse drivers (available for download in downloads.). (not reccommended)
OR
b. Run in PURE DOS by holding F5 on Windows Startup and choosing Command Prompt. You will probably need an XMS or EMS manager to run QBASIC. (Use DOS mouse drivers, available for download in downloads.)
This left for reference.
-------------------------
Not sure how much of a fix this would be, but you could use the ABS function to use only positive values, which would make WINXP and WIN98 correct, although this will require recoding in your program.
Code: Select all
Logic Tables:
| Windows XP | Windows 98
outregs.ax | 1 | -1
ABS(outregs.ax) | 1 | 1
Windows XP cannot be started in "Pure DOS mode"; that's only available in the Win9x family (95, 98, Me).
You also cannot disable the mouse driver; it's built into the NT VDM. (There may be some way to disable it, but it would not be useful.)
I assume this is just a bug in the emulated mouse driver - I don't have access to an XP machine at the moment to test - but I would just check to see that ax <> 0 for an indication of success unless it is seen that this returns false positives on other machines.
You also cannot disable the mouse driver; it's built into the NT VDM. (There may be some way to disable it, but it would not be useful.)
I assume this is just a bug in the emulated mouse driver - I don't have access to an XP machine at the moment to test - but I would just check to see that ax <> 0 for an indication of success unless it is seen that this returns false positives on other machines.
- Michael Calkins
- Veteran
- Posts: 76
- Joined: Tue Apr 05, 2005 8:40 pm
- Location: Floresville, Texas
- Contact:
Pressing F8 gets you a menu from which you can choose "Command prompt only".by holding F5
HIMEM.SYS, and thus XMS should be loaded either from your CONFIG.SYS or automatically.
Not necessary. QBASIC runs in pure conventional. (Some QBASIC programs may use XMS, by design.)probably need an XMS or EMS manager to run QBASIC
As for mouse problems in XP, I have not personally expirienced this (I don't use any NT version), but I have been told that at least 1 of the mouse routines I wrote fails in XP. It works fine in 98SE, and is entirely propper. This means a bug in XP.
Regards,
Michael
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
I like to slay Disciples of D'Sparil...
- Michael Calkins
- Veteran
- Posts: 76
- Joined: Tue Apr 05, 2005 8:40 pm
- Location: Floresville, Texas
- Contact:
Code: Select all
Logic Tables: | Windows XP | Windows 98 outregs.ax | 1 | -1 ABS(outregs.ax) | 1 | 1
According to "Advanced MS-DOS Programming" "The Microsoft(R) Guide for Assembly Language and C Programmers", By Ray Duncan:
Did Microsoft change the rules?Returns:
If mouse support is available
AX = FFFFH
BX = number of mouse buttons
If mouse support is not available
AX = 0000H
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
I like to slay Disciples of D'Sparil...
If you're using XP, or other NT based OS's, you shouldnt be coding DOS. Simple as that.DrV wrote:As I already stated, this only works in Win9x derivatives, not in NT-based OSes like Windows XP.Michael Calkins wrote:Pressing F8 gets you a menu from which you can choose "Command prompt only".by holding F5
HIMEM.SYS, and thus XMS should be loaded either from your CONFIG.SYS or automatically.
I have left this dump.
This only would include 95 & 98, ME requires a Mod to do so...DrV wrote:As I already stated, this only works in Win9x derivatives, not in NT-based OSes like Windows XP.Michael Calkins wrote:Pressing F8 gets you a menu from which you can choose "Command prompt only".by holding F5
HIMEM.SYS, and thus XMS should be loaded either from your CONFIG.SYS or automatically.
- Michael Calkins
- Veteran
- Posts: 76
- Joined: Tue Apr 05, 2005 8:40 pm
- Location: Floresville, Texas
- Contact:
Then use 95b or 98SE :-D
Z!re is sorta right. If someone insists on using NT, then mybe they are better off with native programs. It's a good thing we don't insist on using NT... :-)
Other options: Good DOS emulators (disadvantage: slower than the real thing). Or, boot off of a DOS floppy. With a well-configured floppy, this can be a very good option.
Regards,
Michael
About the 1 vs -1 thingy?
Z!re is sorta right. If someone insists on using NT, then mybe they are better off with native programs. It's a good thing we don't insist on using NT... :-)
Other options: Good DOS emulators (disadvantage: slower than the real thing). Or, boot off of a DOS floppy. With a well-configured floppy, this can be a very good option.
Regards,
Michael
About the 1 vs -1 thingy?
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
I like to slay Disciples of D'Sparil...
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
Sorry, my bad....
It actually STILL return outregs.ax=-1 BUT no pointer appears.... and of course... my mouse ain't working.
So, even though my mouse were supposedly working (with the outregs.ax=-1) it didn't...
And, yes... it is somewhat silly to program QB in NT based OS. But I have used QB for years... and QB IS FUN! Right?
My current lab's PC's were all XP based (except for two older P-III ones... they still use win98SE), so getting my program to run on WINXP has become somewhat a challenge.
It actually STILL return outregs.ax=-1 BUT no pointer appears.... and of course... my mouse ain't working.
So, even though my mouse were supposedly working (with the outregs.ax=-1) it didn't...
And, yes... it is somewhat silly to program QB in NT based OS. But I have used QB for years... and QB IS FUN! Right?
My current lab's PC's were all XP based (except for two older P-III ones... they still use win98SE), so getting my program to run on WINXP has become somewhat a challenge.
One defeated only when one stopped wanting to win
QB on Win XP
I still use QB 3.0 and it has worked fine for me in every operating system that MicroSoft has put out including 3.1, 95, 98, NT3.5, NT4, 2000, and XP. I haven't tried it on ME. The computer I'm using now is XP and it works fine from a Command Prompt.
Mind you, I'm not doing anything with the mouse, or with graphics.
Yesterday I managed to hang my computer. Task manager wouldn't take it out of full screen mode; I had to restart. But I had created an infinate loop; my fault, not the OpSys.
Mind you, I'm not doing anything with the mouse, or with graphics.
Yesterday I managed to hang my computer. Task manager wouldn't take it out of full screen mode; I had to restart. But I had created an infinate loop; my fault, not the OpSys.
--- Zim ---
--- Time flies like an arrow, but fruit flies like a banana ---
--- Time flies like an arrow, but fruit flies like a banana ---
Re: QB on Win XP
I take that back.Zim wrote:I still use QB 3.0 and it has worked fine for me in every operating system that MicroSoft has put out including 3.1, 95, 98, NT3.5, NT4, 2000, and XP...
I have a QB 3.0 text program that writes to line 25. If I start the program from a shortcut and the program starts in a window, then I get an "invalid function call" error and the program bombs just as the program tries to write to line 25 in the window.
If I start the program, then switch to full screen mode, then the program will write correctly to line 25. At that point I can Alt-Enter back to the window and the program continues to run.
The work-around is to start my programs (in Windows) in full-screen mode.
The same problem exists with another program compiled in QB 3.
--- Zim ---
--- Time flies like an arrow, but fruit flies like a banana ---
--- Time flies like an arrow, but fruit flies like a banana ---