Results 1 to 8 of 8

Thread: [RESOLVED] problem scanning with VB6 and WIA

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    5

    Resolved [RESOLVED] problem scanning with VB6 and WIA

    Hi!

    Finally I've found some infos for scanning with VB6 and WIA with Microsoft Windows Image Aquisition Library 2. Unfortunately I have a problem:

    After I've added the component to the tools list, there are 2 new components in the list: DeviceManager and CommonDialog. But I can't drop CommonDialog to a form and I get an error: "System error &H80004005 (-2147467259)".
    Even the source code
    Dim cmdg As CommonDialog
    Dim img As ImageFile
    Set img = cmdg.ShowAcquireImage
    produces an error: "Run-time error '91': Object variable or With block variable not set".

    wiaaut.dll should be registered correctly in Win.7 because it's there from the beginning and "Regsvr32 wiaaut.dll" was also successful.

    I've googled some times but couldn't find a solution.

    And why do the old CommonDialog (i.e. for FileOpen etc.) and the new one have the same name although they don't have anything common?

    Thanks
    PW

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: problem scanning with VB6 and WIA

    Welcome to the forums.

    Were these registered with elevated privileges?
    Is this a 64 bit operating system? If so, search forum for: regsvr32 Win7 64
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    5

    Re: problem scanning with VB6 and WIA

    >Welcome to the forums.

    thanks

    >Were these registered with elevated privileges?

    yes, as admin

    >Is this a 64 bit operating system?

    no, Win.7 Enterpr. SR1 x32

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: problem scanning with VB6 and WIA

    Just because somebody named some class the same as some other class in an unrelated library you wouldn't expect them to do the same thing.

    WIA.CommonDialog simply implements a number of WIA dialogs in one class.


    During the period between XP SP2 and Vista concerns arose over DRM issues with some WIA operations. So Microsoft gutted out a lot of functionality and along the way they broke a few things (and do not plan to fix them). One of these things is the way CommonDialog is constructed. It can no longer be sited on a Form as a Control since it is missing several important ActiveX properties for a control.

    This is a well-known issue first surfaced in 2006 and pretty much anybody who didn't skip all of the Vista Developer materials Microsoft put out should know about it. Skipped Vista? You snooze, you lose!


    You can declare an instance of WIA.CommonDialog and invoke it yet though. See:

    [RESOLVED] WIA Commondialog issue with Windows7

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    5

    Re: problem scanning with VB6 and WIA

    Thanks dilettante, that was the right hint.
    Although WIA was in the list of references, there was a 2nd entry and as soon as I activated it, everything worked well. Don't know why but it works.

  6. #6
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: problem scanning with VB6 and WIA

    Quote Originally Posted by pitwi View Post
    Although WIA was in the list of references, there was a 2nd entry and as soon as I activated it, everything worked well. Don't know why but it works.
    Any more details you can offer on this?

    Like the name of this "2nd entry" in References, and what you mean when you say you "activated" it?

    Could be helpful to others.

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    5

    Re: problem scanning with VB6 and WIA

    > Any more details you can offer on this?
    >
    >Like the name of this "2nd entry" in References

    It's the same as the first: "Microsoft Windows Image Acquisition Library v2.0"

    > and what you mean when you say you "activated" it?

    In the menu /Project/References/

  8. #8
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: [RESOLVED] problem scanning with VB6 and WIA

    Thanks.

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