Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP writing to CD
Message
 
To
24/01/2008 03:57:37
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01284484
Message ID:
01284888
Views:
73
Hi, Gregory!
First of all - thank you!

This morning I did my "burner" :) in the same manner – by creating vb script
and running it by WScript.
It's a pity that VFP can't deal with IStream...

The result is shown here:
http://www.js-software.eu/images/cdburn1.jpg
(This pasture was prepared for russian foxclub so I show long-long file name
in Russian)

Kind regards,
Juri


>>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
>_________
>Juri,
>
>There's a problem with the stream object that is returned. Vfp gets confused whereas it works with wscript
>
>I've put a contribution on AtoutFox last year. You can (1) Format CDs, (2) Use the Addtree (DiskPath_Burn()), and (3) Burn an image (like a downloaded vs2008 image)
>
>I've stopped there. The purpose was to make distribution CDs of my software and that is what I'm using it for
>The links is http://www.atoutfox.com/articles.asp?ACTION=FCONSULTER&ID=0000000487
>
>Skip the French intro - the program is in English
>
>Vista or XPSp2
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform