Home › Forums › TWAIN Classic › It is possible to create a source that will open another?
- This topic has 4 replies, 3 voices, and was last updated 17 years, 8 months ago by gennaro_mac.
- AuthorPosts
Hi people, excuse me for by bad english, I have a “simple” question:
it’s possible to create a twain source that will open another source installed on my computer?
I have this situation … I have installed a twain driver for a Fujitzu scanner, but I must open my own driver to do some things and not the Fujitzu’s one.
Another question … if I implements a DS as a simple C DLL, i have no handle to any window … how can I create a valid handle to a window inner this DLL?
Thank you a lot to everybody!
No, a source can not call another source as all DS calls go via the DSM which can only have one actice source.
The window handle has to com from the calling application.
Best regards,
kaij>it’s possible to create a twain source that will open another source installed on my computer?
yeah, you’re just building 2 projects.
>how can I create a valid handle to a window inner this DLL?
create a a native window, use its handle.
but i think you have at least one other largish issue if you follow this design. the driver for your scanner is occationally going to want to display some errors as dialogs that you’ll have to have one of your projects handle. for an example, unplug your device then try to scan with a twain app. I bet you get a dialog – and when your code does the opening part in twain you won’t get a twain return code telling your app that there is a problem until _after_ you click on the dialog. i had a similar situation and ended up using cbtHooks to deal with it, but truthfully its a hassle becasue i have to have info about the dialogs that i want supressed and every once in a while a driver update comes with a slightly different dialog.
@Kaij wrote:
No, a source can not call another source as all DS calls go via the DSM which can only have one actice source.
..then how does remotesoft work? i’m maybe willing to believe that this can’t be worked around, but i lean heavily toward this being something that can made to happen.
@Kaij wrote:
The window handle has to com from the calling application.
there exist solutions where the calling app doesn’t have to provide the handle
Thank you everybody for the information, and excuse me for the banal request but as you can see from my nick I’m new to Windows programming. Well, if I have to create a dll-own native window, how can I do this? I see a lot of example to create a window in a winapps, where I have as main’s parametere an “HINSTANCE hInstance”. Can I use the “HINSTANCE hModule” of the DllMain?
Thank you a lot!
- AuthorPosts