What are the basic COM components required to burn DVD in Windows XP using .NET?

I am trying to burn a DVD / CD using C # code ...

I used IMAPI2 to burn CD / DVD in Windows XP .. but this gives me an unhandled exception ... like: -

System.InvalidCastException: Cannot pass a COM object of type "IMAPI2.Interop.MsftFileSystemImageClass" to the interface type "IMAPI2.Interop.MsftFileSystemImage". This operation failed because the call to QueryInterface for the COM component for the interface with IID '{7CFF842C-7E97-4807-8304-910DD8F7C051} failed due to the following error: this interface is not supported (exception from HRESULT: 0x80004002 (E_NOINTERFACE) )

Can anyone help me solve this problem. I can not solve this error. This project works fine on Windows7 but cannot work on XP.

+3
source share
2 answers

IMAPI2 is distributed with Vista or higher, XP comes with IMAPI, in which DVDs are not supported. You can download IMAPI2 for XP here .

+1
source

I am interested in this because I am starting a similar project. In any case, it looks like the answer is on the page you're linked to. In the section "BurnMedia application on XP SP3 does not work?", On page 2 of the comments, someone reports the exact same error. Another poster claims that he resolved it by changing:

[ComImport]
[CoClass(typeof(MsftFileSystemImageClass))]
[Guid("7CFF842C-7E97-4807-8304-910DD8F7C051")]
public interface MsftFileSystemImage : IFileSystemImage3, DFileSystemImage_Event
{
}

to

[ComImport]
[Guid("2C941FE1-975B-59BE-A960-9A2A262853A5")]
[CoClass(typeof(MsftFileSystemImageClass))]
public interface MsftFileSystemImage : IFileSystemImage, DFileSystemImage_Event
{
}

interop.

, (, , Windows 7 XP SP3) Vista, ( ).

0

Source: https://habr.com/ru/post/1739258/


All Articles