開發平台(Platform): (Ex: Win10, Linux, ...)
Windows 10
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
VC++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
餵入的資料(Input):
預期的正確結果(Expected Output):
No error
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
hr = CoCreateInstance(CLSID_MbnInterfaceManager,
NULL,
CLSCTX_ALL,
IID_IMbnInterfaceManager,
(void**)&m_gInterfaceMgr);
Debug::Write(__FUNCTION__, "Enter CLSID MbnInterfaceMrg.", DEBUG_TYPE);//QQ
if (FAILED(hr))
{
Debug::Write(__FUNCTION__, "Creating COM Instance of IMbnInterfaceManager Failed.", ERROR_TYPE);
goto __Exit_CreateWWANDevice;
}
hr = m_gInterfaceMgr->GetInterfaces(&psaObjects);
if (FAILED(hr))
{
Debug::Write(__FUNCTION__, "IMbnInterfaceManager::GetInterfaces Failed.", ERROR_TYPE);
goto __Exit_CreateDevice;
}
hr = SafeArrayGetLBound(psaObjects, 1, &lLower);
if (FAILED(hr))
{
Debug::Write(__FUNCTION__, "SafeArrayGetLBound Failed.", ERROR_TYPE);
goto __Exit_CreateDevice;
}
hr = SafeArrayGetUBound(psaObjects, 1, &lUpper);
if (FAILED(hr))
{
Debug::Write(__FUNCTION__, "SafeArrayGetLBound Failed.", ERROR_TYPE);
goto __Exit_CreateDevice;
}
補充說明(Supplement):
小弟為c++的新手 目前拿到一板source code 在debug
此為放在services 的一個服務器 目前遇到的問題是 create com instance 都可以正常過
但到了 GetInterface 還有 SafeArray 都會fail 更怪的是我用手動開啟這個服務器是可以
正常的但是我把系統重開機的話就會跑出這幾段error
請問有人遇過這樣的問題嗎? 真的無解了… 嗚嗚