Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP writing to CD
Message
 
To
23/01/2008 10:46:35
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01284484
Message ID:
01284706
Views:
56
Hi, Tim!

Here is enclosed code from example that I found in Windows SDK for IMAPI2
but I can't resolve the problem when AddTree method is called.
May be somebody help us with this code.
Lparameters lpcFolder2Write
If Empty(lpcFolder2Write)
   lpcFolder2Write="C:\0_Write2CD"
Endif

Local ;
   loDiskMaster As IMAPI2.MsftDiscMaster2, ;
   loRecoder As IMAPI2.MsftDiscRecorder2, ;
   loFSI As IMAPI2FS.MsftFileSystemImage, ;
   loDiscDir As IMAPI2FS.FsiDirectoryItem, ;
   loDiscWriter As IMAPI2.MsftDiscFormat2Data, ;
   lcRecorderID, loResult, loStream

loDiscMaster=Createobject("IMAPI2.MsftDiscMaster2")
lcRecorderID=loDiscMaster.Item(0)
loRecorder=Createobject("IMAPI2.MsftDiscRecorder2")
loRecorder.InitializeDiscRecorder(lcRecorderID)
*!*   loRecorder.EjectMedia()
*!*   lnUserReply=Messagebox("Insert blank CD media!",1+48,"Warning")
*!*   If lnUserReply=2
*!*      Return
*!*   Endif
*!*   loRecorder.CloseTray()

*Here checks for media 
*? loDiscWriter.MediaPhysicallyBlank

loFSI=Createobject("IMAPI2FS.MsftFileSystemImage")
loDiscDir=loFSI.Root
loDiscWriter=Createobject("IMAPI2.MsftDiscFormat2Data")
loDiscWriter.Recorder=loRecorder
? "Current Physical Media Type is: "
?? loDiscWriter.CurrentPhysicalMediaType
loDiscWriter.ClientName="Microsoft Visual FoxPro"
loFSI.FreeMediaBlocks=loDiscWriter.FreeSectorsOnMedia
loFSI.FileSystemsToCreate= 1  && FsiFileSystemISO9660
loDiscDir.AddTree(lpcFolder2Write,.T.)

loResult=loFSI.CreateResultImage
loStream=loResult.ImageStream

Wait "Writing content to CD..." Windows Nowait
loDiscWriter.Write(loStream) && error probably because loStream not formed
Wait "Finished!"
>What are the issues when VFP needs to write to a CD?
>
>Thanks.
>
>
>
>Tim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform