views:

59

answers:

1

I'm trying to write a program in C++ that is able to burn an Audio CD without gaps between the tracks. From what I found, this has only recently been made possible using IMAPI, but should be possible since Windows XP SP2 and Vista SP1. The problem is that I can't find any example code on how to do this.

What I did find is that I need to use IRawCDImageCreator, which can be burnt with IDiscFormat2RawCD, and which exposes a function AddTrack.

First I used following code, which succeeds, to create the MsftDiscFormat2RawCD object.

IDiscFormat2RawCD *rawCD;

if (!SUCCEEDED(CoCreateInstance(__uuidof(MsftDiscFormat2RawCD), NULL, CLSCTX_INPROC_SERVER, __uuidof(IDiscFormat2RawCD), (LPVOID*)&rawCD))) return -1; Next I try to create the IRawCDImageCreator:

IRawCDImageCreator *imageCreator;

HRESULT res = CoCreateInstance(__uuidof(MsftRawCDImageCreator), NULL, CLSCTX_INPROC_SERVER, __uuidof(IRawCDImageCreator), (LPVOID*)&imageCreator); if (!SUCCEEDED(res)) return -2;

This fails however, with error code E_NOINTERFACE.

The IMAPI Interfaces page appears to indicate that I am using the correct object.

About E_NOINTERFACE I did find this blog post which says something about apartment threading, but I'm not sure how I could change this, and why creating the first object works without problems.

A: 

This page says you need to install the Windows Feature Pack for Storage to use the IRawCDImageCreator interface.

interjay
Thanks, I think I read something different somewhere else. This pack isn't available for Vista SP2 or XP SP3 though. When I tried IMAPI_VistaSP1_x86.msu it simply said "The update does not apply to your system"http://thegreenbutton.com/forums/p/74230/364750.aspx#364750 even seems to suggest that it should be included with Vista SP2...
Adion