Question

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?

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top