SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Guest

    How do I use DLLs to control Cdrom

    Hi

    The platform I am using is MS Windows 95/98/NT.

    I would like to be able to eject and load my Cdrom to test the autorun feature, as part of my test script.

    The problem is that the only thing I have found that does both (eject and load) is a DLL function call. Below is what I found on a newsgroup:

    ------------------------------------
    // : Load the DLL called MMSYSTEM.DLL
    // : Then load the library function mciSendString and do the following:
    // :
    // : To open the CD-ROM:
    // :
    // : mciSendString('Set cdaudio door open wait', 0, 0, handle);
    // :
    // : To close the CD-ROM:
    // :
    // : mciSendString('Set cdaudio door closed wait', 0, 0, handle);
    ------------------------------------

    I have not been able to figure out how to make it work. My code below does not compile, the error is "type HANDLE may not be used in a DLL function"

    dll "MMSYSTEM.DLL"
    BOOL mciSendString (String sString, char iNumber, int iNumber2, handle hHandle)

    testcase test()
    mciSendString('Set cdaudio door open wait', 0, 0, NULL)
    ----------------------------

    Can someone help me out

    Thanks

    U



  2. #2
    Guest

    Re: How do I use DLLs to control Cdrom

    Generally you can switch all handle declares in a DLL to long and use 0 for null.

    [-] dll 'MMSYSTEM.DLL'
    [ ] BOOL mciSendString (String sString, char iNumber, int iNumber2, long hHandle)


    [-] testcase test()
    [ ] mciSendString('Set cdaudio door open wait', 0, 0, 0)

    However, I've tried that and I could not load the DLL for some reason. If you have better luck, let me know what the solution was. I need the Help for the DLL to go any further.

    Good Luck.

    -AJ

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:27 AM.

Copyright BetaSoft Inc.