Mouse Programming difficulties on WINXP

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
PipeRifle
Coder
Posts: 13
Joined: Tue Dec 13, 2005 12:51 am
Contact:

Mouse Programming difficulties on WINXP

Post by PipeRifle »

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?
One defeated only when one stopped wanting to win
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations »

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.

Code: Select all

Logic Tables:
                    | Windows XP | Windows 98
outregs.ax          |      1     |     -1
ABS(outregs.ax)     |      1     |      1
All values will become positive, hence ABSolute value :P
DrV
Veteran
Posts: 63
Joined: Thu Jun 02, 2005 9:44 pm

Post by DrV »

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.
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post by Michael Calkins »

by holding F5
Pressing F8 gets you a menu from which you can choose "Command prompt only".
HIMEM.SYS, and thus XMS should be loaded either from your CONFIG.SYS or automatically.
probably need an XMS or EMS manager to run QBASIC
Not necessary. QBASIC runs in pure conventional. (Some QBASIC programs may use XMS, by design.)

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...
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post by Michael Calkins »

Code: Select all

Logic Tables: 
                    | Windows XP | Windows 98 
outregs.ax          |      1     |     -1 
ABS(outregs.ax)     |      1     |      1 
:shock: :?

According to "Advanced MS-DOS Programming" "The Microsoft(R) Guide for Assembly Language and C Programmers", By Ray Duncan:
Returns:

If mouse support is available

AX = FFFFH
BX = number of mouse buttons

If mouse support is not available

AX = 0000H
Did Microsoft change the rules? :?: :x :x
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
DrV
Veteran
Posts: 63
Joined: Thu Jun 02, 2005 9:44 pm

Post by DrV »

Michael Calkins wrote:
by holding F5
Pressing F8 gets you a menu from which you can choose "Command prompt only".
HIMEM.SYS, and thus XMS should be loaded either from your CONFIG.SYS or automatically.
As I already stated, this only works in Win9x derivatives, not in NT-based OSes like Windows XP.
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

DrV wrote:
Michael Calkins wrote:
by holding F5
Pressing F8 gets you a menu from which you can choose "Command prompt only".
HIMEM.SYS, and thus XMS should be loaded either from your CONFIG.SYS or automatically.
As I already stated, this only works in Win9x derivatives, not in NT-based OSes like Windows XP.
If you're using XP, or other NT based OS's, you shouldnt be coding DOS. Simple as that.
I have left this dump.
Guest
Veteran
Posts: 128
Joined: Sun Aug 14, 2005 8:33 pm
Location: Forest Lake, MN
Contact:

Post by Guest »

DrV wrote:
Michael Calkins wrote:
by holding F5
Pressing F8 gets you a menu from which you can choose "Command prompt only".
HIMEM.SYS, and thus XMS should be loaded either from your CONFIG.SYS or automatically.
As I already stated, this only works in Win9x derivatives, not in NT-based OSes like Windows XP.
This only would include 95 & 98, ME requires a Mod to do so...
User avatar
Michael Calkins
Veteran
Posts: 76
Joined: Tue Apr 05, 2005 8:40 pm
Location: Floresville, Texas
Contact:

Post by Michael Calkins »

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?
Bring on the Maulotaurs! oops...
I like to slay Disciples of D'Sparil...
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations »

OOOOOOk I made muchos mistakes :oops:

Use WINXP's boot loader (I know at least WIN2k has one, and if WINXP doesn't, get LILO or GRUB) then dual boot XP and DOS.
PipeRifle
Coder
Posts: 13
Joined: Tue Dec 13, 2005 12:51 am
Contact:

Post by PipeRifle »

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.
One defeated only when one stopped wanting to win
User avatar
Zim
Veteran
Posts: 98
Joined: Mon Dec 05, 2005 4:31 pm
Location: Wisconsin, USA
Contact:

QB on Win XP

Post by Zim »

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.
--- Zim ---
--- Time flies like an arrow, but fruit flies like a banana ---
User avatar
Zim
Veteran
Posts: 98
Joined: Mon Dec 05, 2005 4:31 pm
Location: Wisconsin, USA
Contact:

Re: QB on Win XP

Post by Zim »

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 take that back.

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 ---
Post Reply