TRTC_Windows
TRTC_Windows copied to clipboard
liteav FreeLibrary异常
我的环境是 Visual Studio 2022, 工具集是Visual Studio 2017 - Windows XP (v141_xp)
liteav 11.1.0.4523 ::FreeLibrary(m_hModule); 报异常,如图
` typedef ITRTCCloud* (__cdecl* GetTRTCShareInstance)(); typedef void(__cdecl* DestroyTRTCShareInstance)();
HMODULE m_hModule(nullptr);
GetTRTCShareInstance getTRTCShareInstance(nullptr);
DestroyTRTCShareInstance destroyTRTCShareInstance(nullptr);
ITRTCCloud* m_pCloud(nullptr);
std::wstring wstrDLLPath = _T("liteav.dll");
m_hModule = ::LoadLibraryEx(wstrDLLPath.c_str(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
if (m_hModule)
{
getTRTCShareInstance = (GetTRTCShareInstance)::GetProcAddress(m_hModule, "getTRTCShareInstance");
destroyTRTCShareInstance = (DestroyTRTCShareInstance)::GetProcAddress(m_hModule, "destroyTRTCShareInstance");
m_pCloud = getTRTCShareInstance();
if (m_pCloud)
{
std::string strVersion = m_pCloud->getSDKVersion();
}
}
if (getTRTCShareInstance || m_pCloud)
{
destroyTRTCShareInstance();
m_pCloud = nullptr;
getTRTCShareInstance = nullptr;
destroyTRTCShareInstance = nullptr;
}
if (m_hModule)
{
::FreeLibrary(m_hModule);
}
`