Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7044473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:24:50+00:00 2026-05-28T02:24:50+00:00

I found this tutorial on using WIA in c++, but I don’t understand how

  • 0

I found this tutorial on using WIA in c++, but I don’t understand how to use it. The following doesn’t succeed, and I don’t what exactly is wrong here. Basically I copied the code from the tutorial.

void init() {
    IWiaDevMgr2* devMgr; 
    HRESULT hr = createWiaDeviceManager( &devMgr ); 

    if(!SUCCEEDED(hr))
    {
        std::cout << "couldn't create WIA Device Manager!\n"; 
        return; 
    }
   ...
}

HRESULT createWiaDeviceManager(IWiaDevMgr2** devMgr)
{
    if(devMgr == 0) return E_INVALIDARG; 

    *devMgr = 0; 

    return CoCreateInstance( CLSID_WiaDevMgr2, 0, CLSCTX_LOCAL_SERVER, IID_IWiaDevMgr2, (void**)devMgr); 
}

By the way, I am using Windows 7 64-bit, so using IWiaDevMgr2 should be fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:24:51+00:00Added an answer on May 28, 2026 at 2:24 am

    createWiaDeviceManager always returns -2147221008

    That’s 0x800401f0 when you interpret/display it as an unsigned number. As you should, HRESULT is not a signed type. From the WinError.h SDK file:

    //
    // MessageId: CO_E_NOTINITIALIZED
    //
    // MessageText:
    //
    // CoInitialize has not been called.
    //
    #define CO_E_NOTINITIALIZED              _HRESULT_TYPEDEF_(0x800401F0L)
    

    Add this line to your initialization code:

    CoInitialize(NULL);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this tutorial that explains what I want to do using html but
I just installed mongodb from Synaptic (Using ubuntu 11.10). I'm following this tutorial: http://howtonode.org/express-mongodb
I have found this great tutorial, about uploading files with a Flex app, using
I found this great tutorial on how to use JSON to retrieve Twitter updates,
In this tutorial , I found the following commands. ICACLS %SystemDrive%\Windows\System32\inetsrv\config /Grant Network Service:R
When I was reading this tutorial I noticed the following performance tip about using
I'm using Ubuntu 10, python 2.6.5 I'm following this tutorial: http://www.djangobook.com/en/2.0/chapter02 I followed all
I have just found this great tutorial as it is something that I need.
I'm running through this tutorial found here: http://vb.net-informations.com/crystal-report/vb.net_crystal_report_from_multiple_tables.htm which teaches how to pass a
So I found this: http://tiles.apache.org/framework/tutorial/advanced/nesting-extending.html Here is the example: <definition name=myapp.homepage template=/layouts/classic.jsp> <put-attribute name=title

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.