I can't find the documentation on canceling using IMAPIv2.
Is it the same as in IMAPIv1
I'm not really using IDiscMasterProgressEvents, so I'm not sure how I'm supposed to implement a QueryCancel()
Also, I've seen claims that the cancel is broken on xp sp1/sp2, is it for sure working on Vista

Canceling a burn
Donaghy
Thank you sir!
So after I call that CancelWrite(), how can I reliably know that everything is done
Wait for a IMAPI_FORMAT2_DATA_WRITE_ACTION_COMPLETED
Also, which interface can I get dispatched to do the same thing from erase event Update()
So, basically, this is what I want to do...
class
CTestDataWriter2Event : public ::ATL::CComObjectRootEx<::ATL::CComSingleThreadModel>, public ::ATL::CComCoClass<CTestDataWriter2Event>, public ::ATL::IDispatchImpl< IDispatch, &IID_DDiscFormat2DataEvents, &LIBID_IMAPILib2, IMAPILib2_MajorVersion, IMAPILib2_MinorVersion>, public ::ATL::IDispEventImpl<1, CTestDataWriter2Event, &IID_DDiscFormat2DataEvents, &LIBID_IMAPILib2, IMAPILib2_MajorVersion, IMAPILib2_MinorVersion>{
STDMETHODIMP_(VOID) Update(IDispatch* objectDispatch, IDispatch* progressDispatch){
IDiscFormat2Data* object = NULL;
HRESULT hr = objectDispatch->QueryInterface(IID_PPV_ARGS(&object));
if(mCancelRequested)
object->CancelWrite();
}
bool mCancelRequested;
//...
};
jamba8
There is currently no interface to cancel an erase...
thanks,
Garrett Jacobson
SDE, Optical Platform Group
esharpcoder
Hello,
I checked QueryCancel and seems IMAPI v1really has a problem with burn canceling on both XP and Windows Vista.
Questions:
- I have carefully searched internet resources and found a couple of claims that are related to the subject, but no one notice about problem was found in MS bug lists. So, is it a known issue And what environment it’s applied to XP SP1-SP2, Vista
- Is any separate hotfix available for WinXP or bug fix is just included as part of SP3 realease
- What solution you can propose for Windows Vista Is any fix exists for this platform, or for Vista I should use IMAPI v2 as replacement for v1
Looks forward for your answers,
Thanks a much,
Vlad
1Dave
Without actually running your code, everything looks logically good.
My initial thinking about how to do this was to simply wait for control to return from the Write method.
However, your idea sounded correct too except that when I went to double check, it turns out you've found a small bug in IMAPIv2: we currently do not appear to fire that event properly for IDiscFormat2Data. I will file a bug and try to get this fixed in a future release.
For now, I'd suggest waiting for control to return from Write and use some kind of synchronization/notification event if you need to be sure about it in another thread. The above code looks logically correct to force the burn cancellation though. Be sure to account for the events you may recieve afterwards in your event handler code (so you don't do something you don't want done if the burn was cancelled :)).
Please let me know if you have any more questions!
Thanks,
Garrett Jacobson
SDE, Optical Platform Group
GabiMordov
Hello Vlad,
We do not provide support for IMAPIv1 on Windows XP on this forum. For IMAPIv1 on Windows XP support I advice using http://support.microsoft.com or specific support contract from your ISV company.
For both Windows XP and Windows Vista we strongly advise using IMAPIv2.
QWERTYtech
Ok, one last one hopefully - (part 2 from my question above) - how is this done from the erase update
Grayson Peddie
Hello foobarX!
I can't answer for IMAPIv1 on XP off the top of my head, so if you really need to know, let me know and I'll find the answer for you.
However, as for cancelling burns on IMAPIv2, the 'proper' way to do it is to call IDiscFormat2Data::CancelWrite() when you have received an update event from the object. There should not be any problem calling this from another thread as long as COM was properly initialized and you have correctly handled the interface pointer....calling it during a progress update just simplifies the process by not having to worry about the environment so much.
Calling this function will cancel the burn, however more events may still come as we will try to close the media after a cancellation and we do not handle cancellation in the middle of some stages (ie: if you try to cancel in the middle of 'finalizing media', we will not cancel the finalization, but we will not do anything unecessary afterwards)....
Also please note that cancelling a burn can leave the disc in a very bad state: it may appear that your data is on the disc (as most of the file system structures may have been written), but most of the data could still be missing!
Please let me know if you have any more questions!
thanks,
Garrett Jacobson
SDE, Optical Platform Group