- Topics - 1
- Replies - 5
- Total Posts - 6
not the cc, the twState.
Ah, sorry, I mistook it for twStatus.
I am basing my program on the sample source from the TWAIN Toolkit (TWAIN_32 Sample Source),
so I am updating twState for the ds (between the app and the wrapper).
For example, when getting DG_CONTROL / DAT_USERINTERFACE / MSG_DISABLEDS I go to STATE4, and
when getting DG_CONTROL / DAT_IDENTITY / MSG_CLOSEDS I go to STATE3.
However, I am not tracking the twState when calling the 2nd ds and getting the image data from it (between the wrapper and 2nd ds) as seen in the previous code I posted.
it seems more likely that photoshop isn’t placing a call that the rest are.
This is the log after having sent data to the app’s (gimp, twacker) IMAGEMEMXFER.
For gimp and twacker, when SUCCESS with Count = 0 is returned for DG_CONTROL / DAT_PENDINGXFERS / MSG_ENDXFER, DG_CONTROL / DAT_USERINTERFACE / MSG_DISABLEDS is sent right away by the app. At this point I close the wrapper’s UI with DestroyWindow(hWnd).
DAT_PENDINGXFERS : MSG_ENDXFER // app -> wrapper
— State : 700 // wrapper’s state
Count = 0
DAT_USERINTERFACE : MSG_DISABLEDS
— State : 600 // DestroyWindow(hWnd)
DAT_IDENTITY : MSG_CLOSEDS
— State : 400
However, for Photoshop even if SUCCESS with Count = 0 is returned for DAT_PENDINGXFERS / MSG_ENDXFER, MSG_DISABLEDS does not get sent.
This is the log after having sent data to the Photoshop’s IMAGEMEMXFER.
DAT_PENDINGXFERS : MSG_ENDXFER
— State : 700
Count = 0
// no response
// manually close the UI
DG_CONTROL / DAT_NULL / MSG_CLOSEDSREQ // wrapper -> app
twRc : TWRC_FAILURE
Couldn’t you just call DestroyWindow(hwnd)
It seems I did not explain well enough. Closing the UI is not the problem (it will close if I call DestroyWindow), the problem is that the app or dsm returns FAILURE in response to MSG_CLOSEDSREQ.
Or, the problem is DG_CONTROL / DAT_USERINTERFACE / MSG_DISABLEDS is not sent from Photoshop.
Because of this, Photoshop does not do a DisableDS or CloseDS, so it ends up stopping when in twState=5, I think.
You call CloseDsReq before you call openDsm?
Yes, because I could not call openDsm when a session with the dsm (to talk to the app) was already open.
Are you inheriting from or deriving a class from NativeWindow or CWnd or ..?Are you sure that the messagepump is still pumping?
NativeWindow and CWnd… are you talking C++ or C#?
I am programming in C.
By handle, do you mean the in_hWnd for when the wrapper does openDsm?
twRc = DSM_Entry(&WrapperID, NULL, DG_CONTROL, DAT_PARENT, MSG_OPENDSM, (TW_MEMREF)&in_hWnd);
For in_hWnd, I am doing in_hWnd = (pTW_USERINTERFACE)(pTWMsg->pData)->hParent; when MSG_ENABLEDS is called from the app.
I am not creating a separate messagepump thread.
I am only acting when I get the DS_Entry CALLBACK.