need help: MSCDEX CD-ROM programming in QB 4.5 
Author Message
 need help: MSCDEX CD-ROM programming in QB 4.5

Hi,

        I'm writting a cd audio player as the final project for my computer
class. I've already been able to do most of it (play, stop, resume,
etc..), but am having problems getting the Disc's UPC code (i need this
because i have to build a disc database, and this is the only accurate
way of identifyling a particular cd)...

Here's the code for the subroutine...
All the variable ARE being passed correctly (i quatruple-checked that!)

SUB getupc (devnam$, upc$)              'devnam$ is the device name (usually
MSCD001)
        DIM inreg AS regtypex           'Input / output registers
        DIM outreg AS regtypex
        OPEN devnam$ FOR BINARY AS #1
        filehandle% = FILEATTR(1, 2)
        inreg.bx = filehandle%
        inreg.cx = 11                   'Length of control block
        inreg.ax = &H4402               ' IOCTL function 2 (read)
        upc$ = CHR$(14) + STRING$(10, 0)'Control Block (code 14 = get upc)
        inreg.ds = VARSEG(upc$)         'DS:DX = pointer to control block
        inreg.dx = SADD(upc$)
        CALL interruptx(&H21, inreg, outreg)
        FOR i% = 1 TO 11                        'print UPC code (temp. code for testing only)
                PRINT ASC(MID$(upc$, i%, 1));   'This returns 14, 0, 0 etc.. (the
control block
                                                'was not modified in any way)

        NEXT i%
        PRINT outreg.ax                         'AX returns 11 (# of bytes read = no error)
        SLEEP
        CLOSE #1

END SUB

Is there anyone who has done this before and can help me??
I would really appreciate it!

-Juanfe

(P.S.) Please try to reply by mail...  Also, if you're trying to write
a cd player and are even MORE clueless than i am, then e-mail me and
i'll happily
send you my code (most of it works!) + full docs on MSCDEX.

Thanks In Advance!



Sun, 26 Sep 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. need help: MSCDEX CD-ROM programming

2. help w/ cd-rom and cd-r/cd-rw program, please

3. Get CDRom Info (Using MSCDEX) In QB/ASM

4. QB 4.5 SHELL command in large programme help needed

5. Help needed: QB 4.5 and TSR

6. Incorporating non-QBasic graphics into QB 4.5 programs

7. Modem program for QB 4.5

8. How to take pictures into your QB 4.5 or PB program

9. Password program for QB 4.5

10. Maximum size of QB 4.5 programs?

11. Scientific programming in QB 4.5

12. Problem with QB 4.5 program

 

 
Powered by phpBB® Forum Software