A
Ahti Legonkov
Hello!
I am writing an application that will run in a system where there is
only a 1Gb flash drive where XPe, the application and database
resides. The users must be able to copy some or all of the data to a CD.
After hours of googling and surfing msdn I finally managed to build a
program that writes some files to multi-session CD using IMAPI. But
these IStorage and IStream bits (see code below) are bothering me -
the data doesn't get written to CD until RecordDisc is called.
Obviously the staged data must be kept somewhere (most probably in
some directory on the flash drive). It poses a problem - if there
isn't enough free flash drive space, I would not able to burn a CD. It
must be possible to burn CD without making copies of files prior to
burning (nero and roxio don't copy). But is it possible with IMAPI? If
it is then how would I do that? Should I look into third party APIs
instead?
// select recorder and set format etc.
//...
// XXX: can this be done without temporary files?
CComPtr<IStorage> pStorage;
StgCreateDocfile(L"test", STGM_DIRECT | STGM_CREATE |
STGM_READWRITE | STGM_SHARE_EXCLUSIVE, NULL, &pStorage);
{
CComPtr<IStream> pStream;
pStorage->CreateStream(L"file.txt", STGM_DIRECT | STGM_CREATE |
STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream);
DWORD dw = 0;
pStream->Write("1234567890", 10, &dw);
}
pJolietDiscMaster->AddData(pStorage, 0);
pDiscmMster->RecordDisc(false, true);
Thanks!
I am writing an application that will run in a system where there is
only a 1Gb flash drive where XPe, the application and database
resides. The users must be able to copy some or all of the data to a CD.
After hours of googling and surfing msdn I finally managed to build a
program that writes some files to multi-session CD using IMAPI. But
these IStorage and IStream bits (see code below) are bothering me -
the data doesn't get written to CD until RecordDisc is called.
Obviously the staged data must be kept somewhere (most probably in
some directory on the flash drive). It poses a problem - if there
isn't enough free flash drive space, I would not able to burn a CD. It
must be possible to burn CD without making copies of files prior to
burning (nero and roxio don't copy). But is it possible with IMAPI? If
it is then how would I do that? Should I look into third party APIs
instead?
// select recorder and set format etc.
//...
// XXX: can this be done without temporary files?
CComPtr<IStorage> pStorage;
StgCreateDocfile(L"test", STGM_DIRECT | STGM_CREATE |
STGM_READWRITE | STGM_SHARE_EXCLUSIVE, NULL, &pStorage);
{
CComPtr<IStream> pStream;
pStorage->CreateStream(L"file.txt", STGM_DIRECT | STGM_CREATE |
STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &pStream);
DWORD dw = 0;
pStream->Write("1234567890", 10, &dw);
}
pJolietDiscMaster->AddData(pStorage, 0);
pDiscmMster->RecordDisc(false, true);
Thanks!