G
Guest
I'm trying to access the function GetDiscID from the IDvdInfo2 interface in the DVDNavigator in DirectShow from C#.
Here is the MSDN page on the function:
http://msdn.microsoft.com/archive/d...directx9_c/directx/htm/idvdinfo2getdiscid.asp
Here is a C++ function doing what I want to do in C#:
void GetDVDDiscID(LPCSTR disc, ULONGLONG *discid)
{
HRESULT hr;
IDvdInfo2 *dvdInfo = NULL;
hr = CoCreateInstance(CLSID_DVDNavigator, NULL, CLSCTX_ALL,
IID_IDvdInfo2, (void**)&dvdInfo);
if (FAILED(hr)) return;
OLECHAR olevol[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, disc, -1,
olevol, sizeof(olevol) / sizeof(OLECHAR));
wcscat(olevol, OLESTR("\\video_ts"));
hr = dvdInfo->GetDiscID(olevol, discid);
dvdInfo->Release();
}
Can someone help by writing an equivalent function in C# using interops?
Thanks!
Here is the MSDN page on the function:
http://msdn.microsoft.com/archive/d...directx9_c/directx/htm/idvdinfo2getdiscid.asp
Here is a C++ function doing what I want to do in C#:
void GetDVDDiscID(LPCSTR disc, ULONGLONG *discid)
{
HRESULT hr;
IDvdInfo2 *dvdInfo = NULL;
hr = CoCreateInstance(CLSID_DVDNavigator, NULL, CLSCTX_ALL,
IID_IDvdInfo2, (void**)&dvdInfo);
if (FAILED(hr)) return;
OLECHAR olevol[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, disc, -1,
olevol, sizeof(olevol) / sizeof(OLECHAR));
wcscat(olevol, OLESTR("\\video_ts"));
hr = dvdInfo->GetDiscID(olevol, discid);
dvdInfo->Release();
}
Can someone help by writing an equivalent function in C# using interops?
Thanks!