光盘刻录小结

 

光盘刻录示例程序:

Burning CD/DVD Media with the Image Mastering API Version 2.0 (IMAPI2)

(Prize winner in Competition "Best C++/MFC article of December 2007")

Download From:

http://www.codeproject.com/Articles/22538/Burning-CD-DVD-Media-with-the-Image-Mastering-API

程序中有个小错误:

  原:
    ①
image->put_FileSystemsToCreate((FsiFileSystems)(FsiFileSystemJoliet|FsiFileSystemISO9660));

     ②image->put_VolumeName(pThis->m_volumeLabel.AllocSysString());

     ③image->ChooseImageDefaultsForMediaType(mediaType);

  修改方法:

的顺序应对换,因为ChooseImageDefaultsForMediaType会将光盘的文件系统设为默认的,这样就破环了原先的调用put_FileSystemsToCreate的文件系统设置,修改为如下所示:

image->put_VolumeName(pThis->m_volumeLabel.AllocSysString();

image->ChooseImageDefaultsForMediaType(mediaType);

image->put_FileSystemsToCreate((FsiFileSystems)(FsiFileSystemISO9660 | FsiFileSystemJoliet));

 

光盘插入和弹出消息:

    How to receive notification of CD-ROM insertion or removal。

    网址:http://support.microsoft.com/kb/163503/nl

 

MSDN IMAPI Interfaces

    网址:http://msdn.microsoft.com/en-us/library/windows/desktop/aa366216(v=vs.85).aspx

 

刻录速度:

IDiscFormat2Data::get_CurrentWriteSpeed()

IDiscFormat2Data:: SetWriteSpeed()

IDiscFormat2Data:: get_SupportedWriteSpeeds()

 

设置刻录Image文件的大小(在设置文件系统之后调用),默认只有650M:

HRESULT IFileSystemImage:: put_FreeMediaBlocks( [in]  LONG newVal);

Parameters:

newVal [in]

Number of blocks to use in creating the file system image.

By default, 332,800 blocks are used to create the file system image. This value assumes a capacity of 74 minutes of audio per 650MB disc.

To specify an infinite number of block, set newVal to zero.

也可尝试函数SetMaxMediaBlocksFromDevice()(未验证)。

以下博客文章写得一般,但可以参考:

介绍了多区段刻录:

         IMAPI刻录机:多区段(multisession)续刻:http://blog.csdn.net/crystal0011/article/details/9466343

介绍了硬盘文件系统:

         硬盘、文件系统和存储 blocksector Stripe size区别:http://blog.csdn.net/zhangnn5/article/details/6462036

介绍了多种刻录方法:

光盘刻录编程:http://blog.csdn.net/siow/article/details/568761

介绍了一种刻录方法:

         VC++实现CD/DVD刻录:http://www.cnblogs.com/poethxp/archive/2006/03/10/347599.html

原文地址:https://www.cnblogs.com/ant-wjf/p/3432990.html