TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Reply To: Is TWAIN Still alive ?

Forums › TWAIN Classic › Is TWAIN Still alive ? › Reply To: Is TWAIN Still alive ?

July 11, 2006 at 8:22 am #23422
AGK512
Participant
  • Topics - 1
  • Replies - 6
  • Total Posts - 7

Ah those were the days 🙂

No for this particular application I am using a veryical market language called Visual Dataflex 11.1

It allows the import of ActiveX controls and I’ve had a look at a couple but not had much luck yet

I’ve tried calling the DSM_Entry direct from a test app but at the moment it is just crashing …..

The language has an External_Function command that looks like this

External_Function DSM_Entry “DSM_Entry” twain_32.dll pointer pOrigin uinteger DG uShort DAT uShort MSG pointer pData Returns ushort

I’ve defined some structure to handle the twain data types …

struct TW_INT8
    char TW_Value
end_struct
struct TW_INT16
    short TW_Value
end_struct
struct TW_INT32
    integer TW_Value
end_struct
struct TW_UINT8
    uChar TW_Value
end_struct
struct TW_UINT16
    ushort TW_Value
end_struct
struct TW_UINT32
    uinteger TW_Value
end_struct
struct TW_BOOL
    ushort TW_Value
end_struct
 
struct TW_FIX32
    TW_INT16  Whole
    TW_UINT32 Frac
end_struct
 
struct TW_STR32
    UChar[34] TW_Value
end_struct
struct TW_STR64
    uChar[66] TW_Value
end_struct
struct TW_STR128
    uChar[130] TW_Value
end_struct
struct TW_STR255
    uChar[256] TW_Value
end_struct
struct TW_STR1024
    uChar[1026] TW_Value
end_struct
struct TW_UNI512
    uChar[1024] TW_Value   // whar_t type so two bytes per character.
end_struct
 
struct TW_VERSION
    TW_UINT16  MajorNum
    TW_UINT16  MinorNum
    TW_UINT16  Language
    TW_UINT16  Country
    TW_STR32   Info
end_struct
 
struct TW_IDENTITY
    TW_UINT32  Id
    TW_VERSION Version
    TW_UINT16  ProtocolMajor
    TW_UINT16  ProtocolMinor
    TW_UINT32  SupportedGroups
    TW_STR32   Manufacturer
    TW_STR32   ProductFamily
    TW_STR32   ProductName
end_struct
 

…. and these constants

#replace DG_CONTROL    |CI$0001
#replace DG_IMAGE      |CI$0002
#replace DG_AUDIO      |CI$0004
#replace DAT_PARENT    |CI$0004
#replace MSG_OPENDSM   |CI$0301
#replace MSG_CLOSEDSM  |CI$0302
 
#replace TWLG_ENG       2
#replace TWLG_USA       13
#replace TWCY_UNITEDKINGDOM   44
 
#replace TWON_PROTOCOLMINOR   8
#replace TWON_PROTOCOLMAJOR   1

… my test procedure then ….

        procedure Test
            TW_IDENTITY AppID
            string sVer sManu sFamily sName
            integer iLoop i1 i2
            ushort Result
            handle hWnd
 
            move 0 to AppID.Id.TW_Value
            move 1 to AppID.Version.MajorNum.TW_Value
            move 2 to AppID.Version.MinorNum.TW_Value
            move TWLG_ENG to AppID.Version.Language.TW_Value
            move TWCY_UNITEDKINGDOM to AppID.Version.Country.TW_Value
            move “My App Version” to sVer
            for iLoop from 1 to (length(sVer))
                move (ascii(mid(sVer,1,iLoop))) to AppID.Version.Info.TW_Value[iLoop-1]
            Loop
            move 0 to AppID.Version.Info.TW_Value[length(sVer)]
 
            move TWON_PROTOCOLMAJOR to AppID.ProtocolMajor.TW_Value
            move TWON_PROTOCOLMINOR to AppID.ProtocolMinor.TW_Value
 
            move (DG_IMAGE ior DG_CONTROL) to AppID.SupportedGroups.TW_Value
 
            move “App’s Manufacturer” to sManu
            for iLoop from 1 to (length(sManu))
                move (ascii(mid(sManu,1,iLoop))) to AppID.Manufacturer.TW_Value[iLoop-1]
            Loop
            move 0 to AppID.Manufacturer.TW_Value[length(sManu)]
 
            move “App’s Product Family” to sFamily
            for iLoop from 1 to (length(sFamily))
                move (ascii(mid(sFamily,1,iLoop))) to AppID.ProductFamily.TW_Value[iLoop-1]
            Loop
            move 0 to AppID.ProductFamily.TW_Value[length(sFamily)]
 
            move “App’s Product Name” to sName
            for iLoop from 1 to (length(sName))
                move (ascii(mid(sName,1,iLoop))) to AppID.ProductName.TW_Value[iLoop-1]
            Loop
            move 0 to AppID.ProductName.TW_Value[length(sName)]
 
            get window_handle of myPanel to hWnd
   
            move (DSM_Entry((addressof(AppID)),0,DG_CONTROL,DAT_PARENT,MSG_OPENDSM,(addressof(hwnd)))) to Result
 
        end_procedure

But as I say it is still locking. I’m sure it’s just because I dont have one of the constants or structures correct. C an you give me any clues ?

Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in