Home › Forums › TWAIN Classic › app does not respond to MSG_CLOSEDSREQ… › Reply To: app does not respond to MSG_CLOSEDSREQ…
I am checking the rc codes for DSM_Entry. All are returning success.
twRc = DSM_Entry(&WrapperID, &AppID, DG_CONTROL, DAT_NULL, MSG_CLOSEDSREQ, (TW_MEMREF)NULL);
if (twRc != TWRC_SUCCESS) goto error;
twRc = DSM_Entry(&WrapperID, NULL, DG_CONTROL, DAT_PARENT, MSG_OPENDSM, (TW_MEMREF)&in_hWnd);
if (twRc != TWRC_SUCCESS) goto error;
twRc = DSM_Entry(&WrapperID, NULL, DG_CONTROL, no, MSG_GETFIRST, (TW_MEMREF)&SecondDSID);
if (twRc != TWRC_SUCCESS) goto error;
twRc = DSM_Entry(&WrapperID, NULL, DG_CONTROL, no, MSG_OPENDS, (TW_MEMREF)&SecondDSID);
if (twRc != TWRC_SUCCESS) goto error;
ui.ShowUI = TRUE;
ui.ModalUI = TRUE;
ui.hParent = in_hWnd;
twRc = DSM_Entry(&WrapperID, &SecondDSID, DG_CONTROL, DAT_USERINTERFACE, MSG_ENABLEDS, (TW_MEMREF)&twUI);
if (twRc != TWRC_SUCCESS) goto error;
If I don’t make the first call, DSM_Entry(DG_CONTROL/DAT_NULL/MSG_CLOSEDSREQ), the 2nd one, DMS_Entry(DG_CONTROL/DAT_PARENT/MSG_OPENDSM) does not return, causing the wrapper to stop there.
If I do make that first call to DSM_Entry(DG_CONTROL/DAT_NULL/MSG_CLOSEDSREQ), the other calls all return with success.
After that, I perform a scan from the 2nd DS, pass the scan data to the app, and the app sends DG_CONTROL / DAT_PENDINGXFERS / MSG_ENDXFER. Everything works fine up to this point.
However, the wrapper’s UI does not close after that (It gets closed with IrfanView, so I don’t know why it doesn’t close with Photoshop) so I send DSM_Entry( DG_CONTROL / DAT_NULL / MSG_CLOSEDSREQ ), which gives me rc=TWRC_FAILURE.
For in_hWnd, I am doing in_hWnd = (pTW_USERINTERFACE)(pTWMsg->pData)->hParent; when MSG_ENABLEDS is called from the app.
@gabe wrote:
Which of the 5 DSM_Entry calls from you code do you think is the problem?
I was thinking the problem is with the first DSM_Entry call.
Perhaps since I am already sending MSG_CLOSEDSREQ once there, sending MSG_CLOSEDSREQ again ends up failing.
To retrieve the twState at that time, I can pass &AppID for the 2nd argument, right?
twRc = DSM_Entry(&WrapperID, &AppID, DG_CONTROL, DAT_STATUS, MSG_GET, (TW_STATUS*)&twState);
The twRc for this is also FAILURE.
@gabe wrote:
is this problem reproducable with twacker?
By twacker you mean “TWAIN_32 Twacker”, right?
With Twacker, after returning 0 in response to DG_CONTROL / DAT_PENDINGXFERS / MSG_ENDXFER, the wrapper’s UI closes, so it ends normally without having to send MSG_CLOSEDSREQ. So I cannot reproduce the problem.
thanks