Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Boudewijn Lutgerink
 To: Victor Dinculescu
  Where is Victor Dinculescu?
 Victor Dinculescu
Subject: RE: Check CD- Writer
Thread ID: 20077 Message ID: 52603 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Thursday, September 30, 2004 3:28:18 PM         

> Hi experts,
> I'm a new VFP 6 SP3 user (W2k) - some knowledges on API.
> I would like to automate file saving on CD.
> 1. There is any way to check the CD drive if it is writer ?
> 2. May I check also if the inserted CD is blank or not ? ( Checking diskspace is the same for a blank CD or not CD in drive).
> 3. May I format the CD (UDF) within VFP ?
> Thanks for your time.
> Victor Dinculescu
there is, also check for threrad 52523

to check whether you can write with it
DECLARE INTEGER mciSendString IN winmm as mciSendString ;
      STRING cCommand, STRING @cReturnString, INTEGER nBufferSize, INTEGER hCallback

* cCommand is the string that contains the command to send to the CD Drive
* cReturnString is a buffer that receives the returned information.
* In case you don't want to use this returnvalue make this parameter a NULL
*                      You need it though in your specific case
* nBufferSize is the size of the buffer from param2
*hCallBack is a handle to a callback window, if you don't use it give it a value of 0

*There are many commandstrings you can send to the cd player.
* What you might need in this case is the "status cdaudio media present" string
* this code will return either false or true

LOCAL lcCMD as string, lcRetVal as String, llretVal as logical

lcCMD = "capability cdaudio can record"
* for information whether there IS a CD change this to
* "status cdaudio media present"

lcRetVal = space(255)

lnError = mciSendString(lcCmd, @lcRetVal, Len(lcRetVal), 0)
if lnError = 0
   do case
      case Upper(alltrim(strtran(lcRetVal, CHR(0),"")))="FALSE"
         llRetVal = .F.
      case Upper(alltrim(strtran(lcRetVal, CHR(0),"")))="TRUE"
         llRetVal = .T.
   llRetVal = .F.
return llRetVal

This does not answer all your questions... but hey, though I know it is hard to believe we too are only humans... We can't know everything .
Boudewijn LutgeĀ®ink
There are 10 types of people: Those that do understand binary calculations and those that do not.


Check CD- Writer Posted by Victor Dinculescu @ 2/11/2003 10:23:36 AM
RE: Check CD- Writer Posted by Tim Engstler @ 2/11/2003 3:23:22 PM
RE: Check CD- Writer Posted by Abdul Raop Amran @ 9/30/2004 9:26:40 AM
RE: Check CD- Writer Posted by Boudewijn Lutgerink @ 9/30/2004 3:28:18 PM