- This topic has 2 replies, 2 voices, and was last updated 10 years, 9 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
Forums › TWAIN Classic › cannot convert parameter 1 from ‘TW_STR32’ to ‘LPWSTR’
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!
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.
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