调整disable

This commit is contained in:
yangjiaxuan 2023-05-17 17:39:26 +08:00
parent 4daa005cf8
commit 5423b3da3f
2 changed files with 9 additions and 4 deletions

View File

@ -117,7 +117,7 @@ HGResult DeviceUser::ClearDeviceLog()
void HGAPI DeviceUser::DSCloseReqFunc(HGTwainDS ds, HGPointer param)
{
DeviceUser* p = (DeviceUser*)param;
emit p->closeReq();
HGTwain_DisableDS(p->m_twainDS);
}
void HGAPI DeviceUser::DSImageFunc(HGTwainDS ds, HGImage image, HGPointer param)
@ -133,8 +133,8 @@ void HGAPI DeviceUser::DSImageFunc(HGTwainDS ds, HGImage image, HGPointer param)
void DeviceUser::on_closeReq()
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
HGTwain_DisableDS(m_twainDS);
// std::this_thread::sleep_for(std::chrono::milliseconds(100));
// HGTwain_DisableDS(m_twainDS);
}
#else

View File

@ -557,6 +557,11 @@ HGResult HGTwainDSImpl::Enable(HGBool showUI, HWND parent, HGDSCloseReqFunc even
return HGTWAIN_ERR_FAIL;
}
if (!showUI)
{
HGBase_SetEvent(m_event);
}
m_showUI = showUI;
m_parent = parent;
m_eventFunc = eventFunc;
@ -944,6 +949,6 @@ void HGAPI HGTwainDSImpl::ThreadFunc(HGThread thread, HGPointer param)
}
}
p->Reset();
p->Disable();
}
}