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

cannot convert parameter 1 from ‘TW_STR32’ to ‘LPWSTR’

Forums › TWAIN Classic › cannot convert parameter 1 from ‘TW_STR32’ to ‘LPWSTR’

  • This topic has 2 replies, 2 voices, and was last updated 10 years, 9 months ago by twainuser123.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • April 7, 2010 at 2:44 am #22597 Reply
    twainuser123
    Participant
    • Topics - 9
    • Replies - 28
    • Total Posts - 37

    Hi,

    I am new to TWAIN programming. I was reading the specification and got confused when trying to do this:

    TW_IDENTITY appIdentity;
    appIdentity.SupportedGroups = DF_APP2;
    lstrcpy(appIdentity.Manufacturer, "My Company");

    I got the error message

    error C2664: 'lstrcpyW' : cannot convert parameter 1 from 'TW_STR32' to 'LPWSTR'

    on my Visual C++ Express on Windows Vista.

    The code works in Twacker’s source code.
    Please help. Thanks in advance!

    April 7, 2010 at 1:25 pm #25228 Reply
    Thierry
    Participant
    • Topics - 6
    • Replies - 54
    • Total Posts - 60

    TW_STR32 is Multi Byte and you’re trying to use a Wide Char pointer to acces it, you just can’t (without blowing up your software).
    You need to convert it using MultiByteToWideChar … or to compile in multibyte instead of unicode wide char.

    April 7, 2010 at 4:41 pm #25229 Reply
    twainuser123
    Participant
    • Topics - 9
    • Replies - 28
    • Total Posts - 37

    Thanks for the reply!

    It works with your answer.
    I found more information here as well: http://msdn.microsoft.com/en-us/library/z207t55f%28VS.80%29.aspx

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: cannot convert parameter 1 from ‘TW_STR32’ to ‘LPWSTR’
Your information:




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

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.