0

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?

Jørgen R
  • 10,568
  • 7
  • 42
  • 59
Alex Koustas
  • 91
  • 1
  • 1
  • 7
  • 1
    Are you trying to integrate the scanning function to a desktop app or a browser-based application? – Logan Jun 13 '12 at 02:14
  • You need a TWAIN ActiveX control to be integrated into your powerbuilder app. Just simply search in Google, and you will find several options. – flysakura Jun 15 '12 at 05:35

1 Answers1

2

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.

Maximus
  • 10,751
  • 8
  • 47
  • 65