By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,843 Members | 864 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,843 IT Pros & Developers. It's quick & easy.

IMAPI query cancel doesn't work!

P: n/a
Hey guys,
In my burn project, I have everything working except the
cancellation of the burn. I have it setup such that when the user
initiates a "cancel" the IDiscMasterProgressEvents handler will set the
argument to true as shown:

HRESULT STDMETHODCALLTYPE CDProgressEvents::QueryCancel(boolean
*pbCancel)
{
if (*m_cancel == true)
{
*pbCancel = true;
}
return S_OK;
}

However I can hear the drive still spinning and it finishes burning
every time. Is there a reason as to why this is?

Also on a side note
1) why is it that every time I release the DiscMasterProgressEvents
after ProgressUnAdvise it returns some junk value.
2) Every time I call IDiscMaster->Release() after a close() call it
returns S_FALSE?

Do I not need to make these two calls then? Or is it implied that the
UnAdvise and Close() calls will automatically release?

But mainly why is cancelling not working?

Thanks for any suggestions/comments!
Tony

Apr 4 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
<to****@gmail.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hey guys,
In my burn project, I have everything working except the
cancellation of the burn. I have it setup such that when the user
initiates a "cancel" the IDiscMasterProgressEvents handler will set the
argument to true as shown:

HRESULT STDMETHODCALLTYPE CDProgressEvents::QueryCancel(boolean
*pbCancel)
{
if (*m_cancel == true)
{
*pbCancel = true;
}
return S_OK;
}

However I can hear the drive still spinning and it finishes burning
every time. Is there a reason as to why this is?

Also on a side note
1) why is it that every time I release the DiscMasterProgressEvents
after ProgressUnAdvise it returns some junk value.
2) Every time I call IDiscMaster->Release() after a close() call it
returns S_FALSE?
Not sure I follow this. What is returning junk, and what is the junk?
IUnknown::Release doesn't return an HRESULT.

Do I not need to make these two calls then? Or is it implied that the
UnAdvise and Close() calls will automatically release?
I'd think that you do need the calls. ProgressUnadvise should only release
any additional holds the IDiscMaster has on the thing, and leave you the
responsibility for the final Release. I can't see why Close would do
anything with it after you've unadvised it, and nothing other than a defacto
unadvise if you've managed to leave the sink active.

But mainly why is cancelling not working?


Are you running XPSP2? Not sure if its the same thing, but according to the
author of ISORecorder, Alex Feinman...

http://isorecorder.alexfeinman.com/v2.htm

"Sometime around XPSP1 Microsoft has broken the cancel feature in their
engine. I've caught on it to late to submit it for fixing in SP2. Perhaps
SP3".

--
Jeff Partch [VC++ MVP]
Apr 4 '06 #2

P: n/a
I am using XPSP2, and it seems that cancel is broken there as well.

On another note, these are the calls I made when I release all of the
IMAPI components. Some of the calls commented "might not be needed"
are the ones that don't return S_OK while all the other ones do.
hr = DiscMaster->ProgressUnadvise(uProgressID);
hr = DiscMasterProgressEvents->Release(); // might not be needed
hr = DiscRecorder->Release();
hr = DiscMaster->Close();
hr = DiscMaster->Release(); // might not be needed
hr = JolietDiscMaster->Release();

So the question is: Am I not releasing the components correctly? Or
are the calls simply just not necessary?

Thanks!

Apr 5 '06 #3

P: n/a
<to****@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...
I am using XPSP2, and it seems that cancel is broken there as well.

Yeah, I think that's what Alex was saying -- that it first broke in SP1 and
persists in its broken state through SP2 and we'll have to wait and see if
SP3 will repair it. He implies that he reported it, but I can find no other
mention of it through MS or google.
On another note, these are the calls I made when I release all of the
IMAPI components. Some of the calls commented "might not be needed"
are the ones that don't return S_OK while all the other ones do.
hr = DiscMaster->ProgressUnadvise(uProgressID);
hr = DiscMasterProgressEvents->Release(); // might not be needed


Like I said, IUnknown::Release doesn't return an HRESULT, so looking for it
to return S_OK makes no sense.

--
Jeff Partch [VC++ MVP]
Apr 5 '06 #4

P: n/a
Is release all that is necessary for clean up? Or do I have to do any
other deallocation?

thanks for all the help!

Apr 11 '06 #5

P: n/a
<to****@gmail.com> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...
Is release all that is necessary for clean up? Or do I have to do any
other deallocation?


No sure what all you mean by clean up, but calling Release is all you can do
to relinquish your hold on the object reference, and fulfills your
obligation to the provider.
--
Jeff Partch [VC++ MVP]
Apr 12 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.