How do I call ICDBurn::GetRecorderDriveLetter() in VS2008 C++? (Solving XP CD write to root)

萝らか妹 提交于 2019-12-25 03:16:01

问题


I am trying to implement the solution given in

GetSaveFileName() not returning path of CD burning staging area on XP

I'm trying to implement this in VS2008 C++. The ICDBurn::GetRecorderDriveLetter() method is not static and thus cannot be called as written (ICDBurn::GetRecorderDriveLetter) in the above answer. ICDBurn can't be instantiated because it's an abstract class. How do I call ICDBurn::GetRecorderDriveLetter() from C++?


回答1:


You need to create the COM object first.

ICDBurn* pICDBurn;
HRESULT hr = CoCreateInstance(CLSID_CDBurn, NULL,CLSCTX_INPROC_SERVER,IID_ICDBurn,(LPVOID*)&pICDBurn);
if (SUCCEEDED(hr))
{

// do something ...
pICDBurn->Release();

}


来源:https://stackoverflow.com/questions/5825944/how-do-i-call-icdburngetrecorderdriveletter-in-vs2008-c-solving-xp-cd-wr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!