Results 1 to 4 of 4

Thread: [RESOLVED] WIA Tree

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    935

    Resolved [RESOLVED] WIA Tree

    I'm putting this in the COM forum but usage is VB Classic.
    If in error please move.
    I'm confused over what I'm getting.


    1) In VB I set a reference to Microsoft Windows Image Acquisition

    2) In my VB code if I enter:
    Code:
    WIA.
    I get a boatload of properties.
    However absence from that list is: "deviceManager"

    3) However if I type:
    Code:
    Dim deviceManager As New WIA.deviceManager
    I'm able to use it.

    -----------------
    Question
    ------------------------------------
    What am I missing OR Why is it not included in the list?

  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,054

    Re: WIA Tree

    No idea, it's on the list for me.


  3. #3
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,893

    Re: WIA Tree

    > What am I missing OR Why is it not included in the list?

    You are missing that intellisense in VB6 IDE is context aware. This means that the dropdown list you get by pressing Ctrl+Space depends on the position in current source code where caret is placed.

    If you have Dim deviceManager As New WIA. and press Ctrl+Space at the end of it you'll get list of all coclasses in WIA typelib. These are all publicly creatable classes in VB6 terms.

    If you have Dim deviceManager As WIA. (note there is no New) and press Ctrl+Space at the end of it you'll get list of all types in WIA typelib (interfaces, enums, aliases and UDTs). These are all publicly creatable *and* non-creatable classes in VB6 terms, incl. public enums and public types (VB6 cannot produce aliases in a typelib).

    If you have WIA. only and press Ctrl+Space you should get all publicly callable procedures on global multi-use classes in WIA typelib and all public callable API declares in its typelib modules and all enum entries (from public enums) incl. raw modules names and enum names (note that VB6 cannot produce modules in a typelib)

    VB6 devs never think about or examine carefully w/ comprehension the long list that intellisense spews because coming from external C/C++ references (like ADO, WIA, etc.) it contains entries which don't have "mapping" to any language terms/constructs like aliases and modules so the mental model is broken as it's a clear case of abstraction leak, it's leaking COM details into the language which require understanding underlying technology to fathom.

    cheers,
    </wqw>

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2017
    Posts
    935

    Re: WIA Tree

    fafalone and wqweto: Thanks for responding.

    wqweto: That really helps clear things up.

    My first in depth into WIA (Win-10), so I didn't need this extra confusion.
    Trying to get an old HP2400 scanner to work (exercise to learn WIA).
    Using dilettante scanner test program (codebank), I can at least get a wiatrace.log, where FAX and Scan I'm flying blind.
    Sometimes WIA connects to scanner right away, other times not.
    Sometimes WIA gives me a scan (takes about 8 minutes /somethings hanging), other times Not.
    Just disabled signature signing to see if that may help.

    David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width