twain_user增加获取打开的设备名的接口

This commit is contained in:
luoliangyi 2023-04-08 08:53:10 +08:00
parent 88555e51eb
commit f8939f1198
5 changed files with 25 additions and 0 deletions

View File

@ -12,6 +12,7 @@ HGTwain_OpenSelectedDS
HGTwain_OpenSelectedDSEx
HGTwain_CloseDS
HGTwain_GetDSName
HGTwain_GetDSDeviceName
HGTwain_GetDSDeviceCustomInfo
HGTwain_EnableDSUIOnly
HGTwain_EnableDS

View File

@ -158,6 +158,17 @@ HGResult HGAPI HGTwain_GetDSName(HGTwainDS ds, HGChar* name, HGUInt maxLen)
return twainDSImpl->GetName(name, maxLen);
}
HGResult HGAPI HGTwain_GetDSDeviceName(HGTwainDS ds, HGChar* name, HGUInt maxLen)
{
if (NULL == ds)
{
return HGBASE_ERR_INVALIDARG;
}
HGTwainDSImpl* twainDSImpl = (HGTwainDSImpl*)ds;
return twainDSImpl->GetDeviceName(name, maxLen);
}
HGResult HGAPI HGTwain_GetDSDeviceCustomInfo(HGTwainDS ds, HGTwainDeviceCustomInfo *info)
{
if (NULL == ds)

View File

@ -51,6 +51,8 @@ HGEXPORT HGResult HGAPI HGTwain_CloseDS(HGTwainDS ds);
HGEXPORT HGResult HGAPI HGTwain_GetDSName(HGTwainDS ds, HGChar* name, HGUInt maxLen);
HGEXPORT HGResult HGAPI HGTwain_GetDSDeviceName(HGTwainDS ds, HGChar* name, HGUInt maxLen);
HGEXPORT HGResult HGAPI HGTwain_GetDSDeviceCustomInfo(HGTwainDS ds, HGTwainDeviceCustomInfo *info);
HGEXPORT HGResult HGAPI HGTwain_EnableDSUIOnly(HGTwainDS ds, HWND parent, HGDSCloseReqFunc eventFunc, HGPointer eventParam);

View File

@ -398,6 +398,16 @@ HGResult HGTwainDSImpl::GetName(HGChar* name, HGUInt maxLen)
return HGBASE_ERR_OK;
}
HGResult HGTwainDSImpl::GetDeviceName(HGChar* name, HGUInt maxLen)
{
if (NULL == name || 0 == maxLen)
{
return HGBASE_ERR_INVALIDARG;
}
return HGBASE_ERR_NOTIMPL;
}
HGResult HGTwainDSImpl::GetDeviceCustomInfo(HGTwainDeviceCustomInfo *info)
{
if (NULL == info)

View File

@ -49,6 +49,7 @@ public:
HGResult Open(TW_IDENTITY* iden);
HGResult Close();
HGResult GetName(HGChar* name, HGUInt maxLen);
HGResult GetDeviceName(HGChar* name, HGUInt maxLen);
HGResult GetDeviceCustomInfo(HGTwainDeviceCustomInfo *info);
HGResult EnableUIOnly(HWND parent, HGDSCloseReqFunc eventFunc, HGPointer eventParam);
HGResult Enable(HGBool showUI, HWND parent, HGDSCloseReqFunc eventFunc, HGPointer eventParam,