Tech Off Thread

4 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Problem using application given at "http://msdn.microsoft.com/coding4fun/someassemblyrequired/l

Back to Forum: Tech Off
  • User profile image
    Shaeron

    I have tried working with application "Look at Me! Windows Image Acquisition by Scott  Hanselman
    Corillian Corporation"
    Actually i am using HP Scanner . I have got the command IDs in my hand . it supports four commands rather than five as in case of webcam. But i am not able to know where should i place this id so that scanner can execute this one. MoreOver i have got UID's for them but i dont know which one of them is for scanning. I have observed that id's hav been used in metadata file, can anybody tell me how can i put my ID's there.

     

  • User profile image
    RichardRudek

    So does this mean you've progressed beyond the [COM error] you were getting a  couple of weeks ago  ?

    I think you'll need to state exactly how much of that article you've followed, and where you've deviated.

    For example, did you upgrade WIA from version 1, which is normally installed (on Windows XP), to version 2 ?

    And I assume you understand this, from the article:

    Getting to WIA from .NETThe wiaaut.dll COM automation library can be added via "Add Reference" from with Visual Studio.NET 2005 and a .NET wrapper will be automatically generated. Only devices whose drivers support WIA will be available via this interface.

    Note the bit that I underlined.


    As for the command ID's, you should need to used them, directly. If you've followed the article, the ".NET wrapper" (preceeding sentence) should have created a method for each one, as described in the article - unless I'm reading it wrong.

    Open Object Browser (in Visual Studio) and check.

  • User profile image
    Shaeron

    Thanks for replying.
    I have got out of my COM Error.
    Now i am Struck up at the line

    device.ExecuteCommand(dc.CommandID);

    I am sure that my scanner supports WIA for that I had contacted HP. My scanner supports 4 commands
    "{E208C170-ACAD-11D2-A093-00C04F72DC3C}"
    "{9B26B7B2-ACAD-11D2-A093-00C04F72DC3C}"
    "{9CBA5CE0-DBEA-11D2-8416-00C04FA36145}"
    "{73815942-DBEA-11D2-8416-00C04FA36145)"

    But i am confused about where should i use them .
    How can i update the file generated as WIA.IDeviceCommand.cs(from metadata)
    I am supposing that First two cammands are for Synchronise and Delete all items because same ID's are suppported by WebCam also. Last two ID's are different. I hav visited the page 
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wiaaut/wia/wiax/refwiaaut/consts/commandid.asp
    It also doesnot mention any such constants for scanner so i am very badly strucked in this problem. And I am using WIA 1.0 version which i got from the same link where this code was given. How can i get the newer version of this?
    thanks.
     

  • User profile image
    RichardRudek

    Shaeron wrote:
    

    Thanks for replying.
    I have got out of my COM Error.
    Now i am Struck up at the line

    Yes, I can be a little impatient. I just checked your profile and saw that you posted a separate message.

    Shaeron wrote:
    

    device.ExecuteCommand(dc.CommandID);

    I am sure that my scanner supports WIA for that I had contacted HP. My scanner supports 4 commands
    "{E208C170-ACAD-11D2-A093-00C04F72DC3C}"
    "{9B26B7B2-ACAD-11D2-A093-00C04F72DC3C}"
    "{9CBA5CE0-DBEA-11D2-8416-00C04FA36145}"
    "{73815942-DBEA-11D2-8416-00C04FA36145)"

    But i am confused about where should i use them .

    How can i update the file generated as WIA. IDeviceCommand.cs(from metadata)
    I am supposing that First two cammands are for Synchronise and Delete all items because same ID's are suppported by WebCam also. Last two ID's are different. I hav visited the page 
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wiaaut/wia/wiax/refwiaaut/consts/commandid.asp
    It also doesnot mention any such constants for scanner so i am very badly strucked in this problem.

    For some reason, the Code4Fun page is no longer accessible, my web brower's cache hasn't got a copy, and Microsoft are deliberately prevent archive.org rom caching, which means that at this point, I can't read the pages for you... not that I have the time...

    Anyway, I don't remember that the article mentioned doing thing this way. From memory, it gave some background as to how this stuff was being wired up, behind the scenes, and then pointed you to using the wrapper class.

    Even the link you provided above does a similar thing.

    Shaeron wrote:
    And I am using WIA 1.0 version which i got from the same link where this code was given. How can i get the newer version of this?
    thanks.



    Once again, I'm pretty sure the article had a link to the download (which I did not download).

    Though why you ignored the fact the article stated that it needed the upgrade, beforehand, and now your ignoring this, I just don't understand.

    Perhaps you not being clear, and your first attempt at upgrading WIA to version 2 produced the original COM object problem.  I seem to recall the {..} GUID was for a version of WIA which I did not have installed  - version 2  perhaps ?.

    So, rather than upgrading WIA, first determine wether you can use the existing version - which means your deviating (subtantially) from the article !!

    So what's next ?

    Find someone who is a .NET developer to mentor you - I am not.

    But in the meantime, you can examine the existing WIA COM object using [Object Browser].  You'll probably need to add a reference to your project, though you can force Object Browser to include the type library for WIA.

    On my system, without a project loaded in Visual Studio 2005, I open Object Browser, then I click the "..." button next to the Browse drop-down list. This opens an "Edit Custom Component Set" dialog. Choose the COM tab, find the WIA object, add it, and then OK.





    You should now be able to browse it.



Conversation locked

This conversation has been locked by the site admins. No new comments can be made.