From: vishalvpv on
Hi,

Here is the code snippet without error handlers.

HRESULT hr = OleInitialize(NULL);

hr = CoCreateInstance(CLSID_MSDiscMasterObj,
NULL,
CLSCTX_INPROC_SERVER|
CLSCTX_LOCAL_SERVER,
IID_IDiscMaster,
(void**)&pDiscMaster);


hr = pDiscMaster->Open();

hr = pDiscMaster->SetActiveDiscMasterFormat(IID_IJolietDiscMaster,
(void**)&pJolietDiscMaster);

hr = pDiscMaster->EnumDiscRecorders(&pEnumDiscRecorders);

hr = pEnumDiscRecorders->Next(1,&pDiscRecorder,&cnt);

hr = pDiscMaster->SetActiveDiscRecorder(pDiscRecorder);

This works great on Windows XP but fails on Vista (32 bit and 64 bit).
The error number is -2147220977 for the SetActiveDiscRecorder Api.
Sometimes this code also fails on the Next method call returning
SFALSE.

Notepad and explorer are able to write files to the CD but the above
test code is failing. As per the posts IMapi version 1 is supported on
Vista.

Please help.

Best Regards,
Vishal
From: Henry on
vishalvpv(a)gmail.com wrote:
> Hi,
>
> Here is the code snippet without error handlers.
>
> HRESULT hr = OleInitialize(NULL);
>
> hr = CoCreateInstance(CLSID_MSDiscMasterObj,
> NULL,
> CLSCTX_INPROC_SERVER|
> CLSCTX_LOCAL_SERVER,
> IID_IDiscMaster,
> (void**)&pDiscMaster);
>
>
> hr = pDiscMaster->Open();
>
> hr = pDiscMaster->SetActiveDiscMasterFormat(IID_IJolietDiscMaster,
> (void**)&pJolietDiscMaster);
>
> hr = pDiscMaster->EnumDiscRecorders(&pEnumDiscRecorders);
>
> hr = pEnumDiscRecorders->Next(1,&pDiscRecorder,&cnt);
>
> hr = pDiscMaster->SetActiveDiscRecorder(pDiscRecorder);
>
> This works great on Windows XP but fails on Vista (32 bit and 64 bit).
> The error number is -2147220977 for the SetActiveDiscRecorder Api.
> Sometimes this code also fails on the Next method call returning
> SFALSE.
>

The error is EVENT_E_INVALID_EVENT_CLASS_PARTITION
Have you tried with IID_IRedbookDiscMaster ?
From: vishalvpv on
On Dec 19, 10:05 am, Henry <he...(a)juke.com> wrote:
> vishal...(a)gmail.com wrote:
> > Hi,
>
> > Here is the code snippet without error handlers.
>
> > HRESULT hr = OleInitialize(NULL);
>
> > hr = CoCreateInstance(CLSID_MSDiscMasterObj,
> >                                   NULL,
> >                                  CLSCTX_INPROC_SERVER|
> > CLSCTX_LOCAL_SERVER,
> >                                  IID_IDiscMaster,
> >                                  (void**)&pDiscMaster);
>
> > hr = pDiscMaster->Open();
>
> > hr = pDiscMaster->SetActiveDiscMasterFormat(IID_IJolietDiscMaster,
> > (void**)&pJolietDiscMaster);
>
> > hr = pDiscMaster->EnumDiscRecorders(&pEnumDiscRecorders);
>
> > hr = pEnumDiscRecorders->Next(1,&pDiscRecorder,&cnt);
>
> > hr = pDiscMaster->SetActiveDiscRecorder(pDiscRecorder);
>
> > This works great on Windows XP but fails on Vista (32 bit and 64 bit).
> > The error number is -2147220977 for the SetActiveDiscRecorder Api.
> > Sometimes this code also fails on the Next method call returning
> > SFALSE.
>
> The error is EVENT_E_INVALID_EVENT_CLASS_PARTITION
> Have you tried with IID_IRedbookDiscMaster ?

Yes this seems to work fine. Thanks.
From: vishalvpv on
On Dec 20, 1:15 am, vishal...(a)gmail.com wrote:
> On Dec 19, 10:05 am, Henry <he...(a)juke.com> wrote:
>
>
>
> > vishal...(a)gmail.com wrote:
> > > Hi,
>
> > > Here is the code snippet without error handlers.
>
> > > HRESULT hr = OleInitialize(NULL);
>
> > > hr = CoCreateInstance(CLSID_MSDiscMasterObj,
> > >                                   NULL,
> > >                                  CLSCTX_INPROC_SERVER|
> > > CLSCTX_LOCAL_SERVER,
> > >                                  IID_IDiscMaster,
> > >                                  (void**)&pDiscMaster);
>
> > > hr = pDiscMaster->Open();
>
> > > hr = pDiscMaster->SetActiveDiscMasterFormat(IID_IJolietDiscMaster,
> > > (void**)&pJolietDiscMaster);
>
> > > hr = pDiscMaster->EnumDiscRecorders(&pEnumDiscRecorders);
>
> > > hr = pEnumDiscRecorders->Next(1,&pDiscRecorder,&cnt);
>
> > > hr = pDiscMaster->SetActiveDiscRecorder(pDiscRecorder);
>
> > > This works great on Windows XP but fails on Vista (32 bit and 64 bit)..
> > > The error number is -2147220977 for the SetActiveDiscRecorder Api.
> > > Sometimes this code also fails on the Next method call returning
> > > SFALSE.
>
> > The error is EVENT_E_INVALID_EVENT_CLASS_PARTITION
> > Have you tried with IID_IRedbookDiscMaster ?
>
> Yes this seems to work fine. Thanks.

Hi Henry,

After going through some more documentation following are the
questions that I have:
1. What does the error EVENT_E_INVALID_EVENT_CLASS_PARTITION mean?
2. As I understand Joliet format is used for data files while Redbook
format is used for audio files. So is Vista not supporting Joliet or
is the hardware / media not supporting Joliet? BTW my file is a data
file so is it correct to audio format for the file?

Best Regards,
Vishal
From: vishalvpv on
On Dec 22, 3:24 pm, vishal...(a)gmail.com wrote:
> On Dec 20, 1:15 am, vishal...(a)gmail.com wrote:
>
>
>
> > On Dec 19, 10:05 am, Henry <he...(a)juke.com> wrote:
>
> > > vishal...(a)gmail.com wrote:
> > > > Hi,
>
> > > > Here is the code snippet without error handlers.
>
> > > > HRESULT hr = OleInitialize(NULL);
>
> > > > hr = CoCreateInstance(CLSID_MSDiscMasterObj,
> > > >                                   NULL,
> > > >                                  CLSCTX_INPROC_SERVER|
> > > > CLSCTX_LOCAL_SERVER,
> > > >                                  IID_IDiscMaster,
> > > >                                  (void**)&pDiscMaster);
>
> > > > hr = pDiscMaster->Open();
>
> > > > hr = pDiscMaster->SetActiveDiscMasterFormat(IID_IJolietDiscMaster,
> > > > (void**)&pJolietDiscMaster);
>
> > > > hr = pDiscMaster->EnumDiscRecorders(&pEnumDiscRecorders);
>
> > > > hr = pEnumDiscRecorders->Next(1,&pDiscRecorder,&cnt);
>
> > > > hr = pDiscMaster->SetActiveDiscRecorder(pDiscRecorder);
>
> > > > This works great on Windows XP but fails on Vista (32 bit and 64 bit).
> > > > The error number is -2147220977 for the SetActiveDiscRecorder Api.
> > > > Sometimes this code also fails on the Next method call returning
> > > > SFALSE.
>
> > > The error is EVENT_E_INVALID_EVENT_CLASS_PARTITION
> > > Have you tried with IID_IRedbookDiscMaster ?
>
> > Yes this seems to work fine. Thanks.
>
> Hi Henry,
>
> After going through some more documentation following are the
> questions that I have:
> 1. What does the error EVENT_E_INVALID_EVENT_CLASS_PARTITION mean?
> 2. As I understand Joliet format is used for data files while Redbook
> format is used for audio files. So is Vista not supporting Joliet or
> is the hardware / media not supporting Joliet? BTW my file is a data
> file so is it correct to audio format for the file?
>
> Best Regards,
> Vishal

Hi Henry,

Here is one more piece of information. When I debug the code on Vista
I can see following messages in the output screen of Visual Studio. I
cannot explain these messages.

This is for the open call i.e. hr = pDiscMaster->Open();
First-chance exception at 0x75d53843 in CDTest.exe: Microsoft C++
exception: SmartClassPtr<CIMAPIException,CIMAPIException> at memory
location 0x0017fae8..
First-chance exception at 0x75d53843 in CDTest.exe: Microsoft C++
exception: [rethrow] at memory location 0x00000000..
'CDTest.exe': Loaded 'C:\Windows\SysWOW64\rsaenh.dll', No symbols
loaded.

This is for the setactivediscrecorder call i.e. hr = pDiscMaster-
>SetActiveDiscRecorder(pDiscRecorder); .
First-chance exception at 0x75d53843 in CDTest.exe: Microsoft C++
exception: SmartClassPtr<CIMAPIException,CIMAPIException> at memory
location 0x0017fa68..
First-chance exception at 0x75d53843 in CDTest.exe: Microsoft C++
exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x75d53843 in CDTest.exe: Microsoft C++
exception: [rethrow] at memory location 0x00000000..

Best Regards,
Vishal