Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / October 2003



Tip: Looking for answers? Try searching our database.

Windows XP built in CD writing support

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob - 30 Oct 2003 08:03 GMT
Hi there,

Anybody able to tell me how I can call XP's built in CD writing wizard? Even
just calling whatever is called when you right click the CD Writer in
Explorer and click on "Write these files to CD"...?

If this is possible, anyone know of a way to automate the whole thing
without having to resort to C++ IMAPI... way too hard...?

Cheers
Eduardo A. Morcillo [MS MVP] - 30 Oct 2003 15:47 GMT
> Anybody able to tell me how I can call XP's built in CD writing
> wizard? Even just calling whatever is called when you right click the
> CD Writer in Explorer and click on "Write these files to CD"...?

There's an interface called ICDBurn that can be used to start the wizard.
This interface is provided by the shell but you will need a type library to
use it from VB. It's included in the OLELIB type library that's in my site.
Once you get the type library just declare a variable using the CDBurn
class.

Signature

Eduardo A. Morcillo [MS MVP]
http://www.mvps.org/emorcillo

Bob - 30 Oct 2003 23:17 GMT
Hi Eduardo...

I've had a look at this but having some troubles... you have some good
samples included but none cover this particular function...

Anyway, don't suppose you have a small sample (preferably VB or VB.Net) I
could look at? I will be using in a VB.Net app (assuming I can get it to
work).

Cheers

> > Anybody able to tell me how I can call XP's built in CD writing
> > wizard? Even just calling whatever is called when you right click the
[quoted text clipped - 5 lines]
> Once you get the type library just declare a variable using the CDBurn
> class.
Eduardo A. Morcillo [MS MVP] - 31 Oct 2003 05:41 GMT
> I've had a look at this but having some troubles... you have some good
> samples included but none cover this particular function...
>
> Anyway, don't suppose you have a small sample (preferably VB or
> VB.Net) I could look at? I will be using in a VB.Net app (assuming I
> can get it to work).

There's no sample because I don't have a CD writter to test it :-(

Signature

Eduardo A. Morcillo [MS MVP]
http://www.mvps.org/emorcillo

Bob - 31 Oct 2003 12:38 GMT
Bummer... that'd make it difficult... so you can't give me a better idea of
the syntax?

I tried this:

   Dim objCD As CDBurn
   Set objCD = New CDBurn

   If objCD.HasRecordableDrive Then
       Dim strDrive As String
       strDrive = objCD.GetRecorderDriveLetter("z:", 1)
       Dim lngResult As Long
       lngResult = objCD.Burn
   Else
       MsgBox "No CD writer found", vbOKOnly + vbExclamation, ""
   End If

It doesn't work of course... not sure what handle to pass the Burn method,
whether the first parameter for GetRecorderDriveLetter is correct, or even
what the second parameter is... also the type library doesn't indicate what
datatype is returned by the GetRecorderDriveLetter or Burn methods so I took
a guess...

Any clues?

Cheers again

> > I've had a look at this but having some troubles... you have some good
> > samples included but none cover this particular function...
[quoted text clipped - 4 lines]
>
> There's no sample because I don't have a CD writter to test it :-(
Eduardo A. Morcillo [MS MVP] - 31 Oct 2003 15:54 GMT
The interface is documented in the MSDN:

http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ifaces/
icdburn/icdburn.asp


Signature

Eduardo A. Morcillo [MS MVP]
http://www.mvps.org/emorcillo

Randy Birch - 31 Oct 2003 23:44 GMT
Bob ...

ICDBurn::GetRecorderDriveLetter returns the CD drive letter ... you pass a
buffer and the buffer size and the drive letter is returned. It's not
required for the Burn method however. Try:

   Dim objCD As CDBurn
   Set objCD = New CDBurn

   If objCD.HasRecordableDrive Then
       Dim strDrive As String
       dim buff as string
       dim buffsize as long
       Dim lngResult As Long
       const S_OK as long = 0

       buff = space$(4)
       buffsize = len(buff)

       if objCD.GetRecorderDriveLetter(buff, buffsize) = S_OK then

             lngResult = objCD.Burn(me.hwnd)

       else
         msgbox "no drive letter returned"
       end if
   Else
       MsgBox "No CD writer found", vbOKOnly + vbExclamation, ""
   End If

Signature

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.

: Bummer... that'd make it difficult... so you can't give me a better idea of
: the syntax?
[quoted text clipped - 31 lines]
: >
: > There's no sample because I don't have a CD writter to test it :-(
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.