Page 1 of 1

Mouse Programming difficulties on WINXP

Posted: Mon Dec 26, 2005 3:39 am
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?

Posted: Mon Dec 26, 2005 7:03 pm
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

Posted: Tue Dec 27, 2005 9:28 pm
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.

Posted: Wed Dec 28, 2005 12:25 am
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

Posted: Wed Dec 28, 2005 12:33 am
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

Posted: Wed Dec 28, 2005 7:26 pm
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.

Posted: Thu Dec 29, 2005 9:36 am
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.

Posted: Thu Dec 29, 2005 12:13 pm
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...

Posted: Thu Dec 29, 2005 1:00 pm
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?

Posted: Thu Dec 29, 2005 5:59 pm
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.

Posted: Thu Jan 12, 2006 10:14 pm
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.

QB on Win XP

Posted: Fri Jan 13, 2006 11:57 am
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.

Re: QB on Win XP

Posted: Thu Jan 19, 2006 12:29 pm
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.