IMAPI having issues with IDiscRecorder QueryMediaType

  • Thread starter Thread starter tonylc
  • Start date Start date
T

tonylc

I would like to do some error checking to see if the CD is write
protected or not or whether there is even a CD media at all. From what
I gather I should be calling the method QueryMediaType. However, on
the call right before I set my DiscRecorder

hr = pDiscMaster->SetActiveDiscRecorder(pDiscRecorder);

I keep getting same HRESULT

-2147220964


Since my Recorder isn't set, I can't make the QueryMediaType call.
Other than that the CD burning works.

This is the order i'm making the method calls

IDiscMaster->Open
SetActiveDiscMasterFormat( IJolietDiscMaster )
IDiscMaster->EnumDiscRecorders( IEnumDiscRecorders )
IEnumDiscRecorders->Next( IDiscRecorder )
IDiscMaster->SetActiveDiscRecorder( IDiscRecorder )

Any ideas?

Greatly Appreciated! Thanks!
 
I would like to do some error checking to see if the CD is write
protected or not or whether there is even a CD media at all. From what
I gather I should be calling the method QueryMediaType. However, on
the call right before I set my DiscRecorder

hr = pDiscMaster->SetActiveDiscRecorder(pDiscRecorder);

I keep getting same HRESULT

-2147220964


That appears to be IMAPI_E_DISCFULL, about which the SetActiveDiscRecorder
documentation curiously says, "the active recorder is still set and
initialized. ".
Since my Recorder isn't set, I can't make the QueryMediaType call.

I'm no authority, but I don't think you need to -- and maybe shouldn't, wait
until after SetActiveDiscRecorder to call QueryMediaType.
Other than that the CD burning works.

Now that sounds odd that it works after an IMAPI_E_DISCFULL. :)
 
Oh no, I get that result because I am either not putting a disc in or
putting a disc that is write protected. If I put a writeable disc
everything works fine.

I'm just curious because isn't it the case when I put in a faulty disc
that I can call QueryMediaType to find out what type of error I have?

Thanks,
Tony
 
I'm just curious because isn't it the case when I put in a faulty disc
that I can call QueryMediaType to find out what type of error I have?

You can call QMT to find out what type of media you have in the recorder.
 
I think you're getting confused by what I am saying. It is because the
SetActiveDiscRecorder is failing so that I can't call QMT. Is
SetActiveDiscRecorder suppose to fail when there is NO CD or when there
is a write protected CD?

Thanks,
Tony
 
I think you're getting confused by what I am saying.

No, not really. :)
It is because the
SetActiveDiscRecorder is failing so that I can't call QMT.

Like I said before, SetActiveDiscRecorder has nothing to do with your
ability to call QMT or any IDiscRecorder method...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/imapi/imapi/idiscrecorder.asp

"All [methods] may be used on an IDiscRecorder object even if the disc
recorder is not the active disc recorder. The IMAPI client does not have to
call IDiscMaster::SetActiveDiscRecorder first".
Is
SetActiveDiscRecorder suppose to fail when there is NO CD or when there
is a write protected CD?

Based on the documented return codes, I'd say yes...

http://msdn.microsoft.com/library/d...i/imapi/idiscmaster_setactivediscrecorder.asp

IMAPI_E_DISCFULL
The disc in the drive is one of the following media types: CD-ROM, audio
CD-R(W), or full CD-R(W). Note that the active recorder is still set and
initialized.
IMAPI_E_MEDIUM_NOTPRESENT
There is no medium in the burner.
 
ahhhh..i got it!

thanks! =D

I think you're getting confused by what I am saying.

No, not really. :)
It is because the
SetActiveDiscRecorder is failing so that I can't call QMT.

Like I said before, SetActiveDiscRecorder has nothing to do with your
ability to call QMT or any IDiscRecorder method...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/imapi/imapi/idiscrecorder.asp

"All [methods] may be used on an IDiscRecorder object even if the disc
recorder is not the active disc recorder. The IMAPI client does not have to
call IDiscMaster::SetActiveDiscRecorder first".
Is
SetActiveDiscRecorder suppose to fail when there is NO CD or when there
is a write protected CD?

Based on the documented return codes, I'd say yes...

http://msdn.microsoft.com/library/d...i/imapi/idiscmaster_setactivediscrecorder.asp

IMAPI_E_DISCFULL
The disc in the drive is one of the following media types: CD-ROM, audio
CD-R(W), or full CD-R(W). Note that the active recorder is still set and
initialized.
IMAPI_E_MEDIUM_NOTPRESENT
There is no medium in the burner.
 
Back
Top