We have a powerbuilder application and we want use a scanner through this application with the use of the TWAIN drivers. Does anyone have previous experience or code samples about how this can be developed?

有帮助吗?

解决方案

It's hard (and may be impossible) to integrate TWAIN into PowerBuilder using plain PowerScript (without regard for possible ActiveX control).

Working solution (for me) was creation of Dll (C++) based on TWAIN Sample code. In brief

  • PowerBuilder app creates response window (modal dialog)
  • call Dll function to override window proc: SetWindowLong(handle(..), GWL_WNDPROC, MyFunction)
  • and initiate TWAIN transfer.

Sample application in C++ is working. But, of course, some changes required to adopt it for PowerBuilder.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top