Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / April 2006

Tip: Looking for answers? Try searching our database.

IMAPI query cancel doesn't work!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tonylc@gmail.com - 04 Apr 2006 02:41 GMT
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
Jeff Partch [MVP] - 04 Apr 2006 14:50 GMT
> Hey guys,
>   In my burn project, I have everything working except the
[quoted text clipped - 20 lines]
> 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".

Signature

Jeff Partch [VC++ MVP]

tonylc@gmail.com - 05 Apr 2006 01:52 GMT
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!
Jeff Partch [MVP] - 05 Apr 2006 03:40 GMT
>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.

Signature

Jeff Partch [VC++ MVP]

tonylc@gmail.com - 12 Apr 2006 00:08 GMT
Is release all that is necessary for clean up?  Or do I have to do any
other deallocation?

thanks for all the help!
Jeff Partch [MVP] - 12 Apr 2006 10:05 GMT
> 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.
Signature

Jeff Partch [VC++ MVP]


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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



©2008 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.