2005 Error C2664
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more
Error C2664 Cannot Convert Parameter
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users error c2664 cannot convert parameter 1 from Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping error c2664 in c++ each other. Join them; it only takes a minute: Sign up C2664 error c++ Visual Studio up vote 0 down vote favorite I am trying to modify an old MFC program. After opening the project in Visual Studio 2013
Error C2664 Lpcwstr
there are many errors of the type below. In AviPlay.cpp #include "stdafx.h" #include "AviPlay.h" #define OPEN_AVI_VIDEO "open avivideo" BOOL initAVI() { return mciSendString(OPEN_AVI_VIDEO, NULL, 0, NULL) == 0; } The error thrown is error C2664: 'MCIERROR mciSendStringW(LPCWSTR,LPWSTR,UINT,HWND)' : cannot convert argument 1 from 'const char [14]' to 'LPCWSTR' Should setting the compiler option for Strict to off, or some other compiler option, resolve this error? If not, I can modify the many lines of code manually. In
Error C2664 Cannot Convert Argument
that case, what might have changed in the last 15 years that would make code like this OK before but not OK now? Thank you in advance. c++ visual-studio-2013 c2664 share|improve this question asked Aug 12 '14 at 1:44 user3931552 11 1 You could try setting the project type to multibyte rather than unicode, but I do not know if that is a valid option when using MFC. –Retired Ninja Aug 12 '14 at 1:48 The project might be set to unicode character set. This would cause your program to link to the wide version of mciSendStringW rather than the multibyte version mciSendStringA. –Beed Aug 12 '14 at 1:49 Setting to multibyte in project properties, general, character set fixed my problem. Thank you very much! –user3931552 Aug 14 '14 at 17:14 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote LPCWSTR tells you it is expecting a wchar_t string, not a char string. By default, all Windows APIs now accept wchar_t strings (unicode). You can change it back to char strings in the project properties, General page, Character Set. Setting it to 'Use Multibyte char set' will get it working as it used to. share|improve this answer answered Aug 12 '14 at 1:54 ScottMcP-MVP 8,9592613 add a comment| Your Answer draft saved draft discarded Sign up or l
resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners error c2664 cannot convert parameter from const char to lpcwstr ISV Startups TechRewards Events Community Magazine Forums Blogs Tech
Mfc Error C2664
Advisors Channel 9 Documentation APIs and reference Dev centers Retired content Samples We’re sorry. The error c2664 cannot convert argument 1 from content you requested has been removed. You’ll be auto redirected in 1 second. C/C++ Building Reference C/C++ Build Errors Compiler Errors C2600 Through C2699 http://stackoverflow.com/questions/25254938/c2664-error-c-visual-studio Compiler Errors C2600 Through C2699 Compiler Error C2664 Compiler Error C2664 Compiler Error C2664 Compiler Error C2600 Compiler Error C2601 Compiler Error C2602 Compiler Error C2603 Compiler Error C2605 Compiler Error C2611 Compiler Error C2612 Compiler Error C2614 Compiler Error C2616 Compiler Error C2617 Compiler Error C2619 Compiler https://msdn.microsoft.com/en-us/library/s5b150wd.aspx Error C2624 Compiler Error C2626 Compiler Error C2627 Compiler Error C2628 Compiler Error C2630 Compiler Error C2632 Compiler Error C2633 Compiler Error C2634 Compiler Error C2635 Compiler Error C2636 Compiler Error C2637 Compiler Error C2638 Compiler Error C2640 Compiler Error C2645 Compiler Error C2646 Compiler Error C2647 Compiler Error C2648 Compiler Error C2650 Compiler Error C2651 Compiler Error C2652 Compiler Error C2653 Compiler Error C2654 Compiler Error C2655 Compiler Error C2656 Compiler Error C2657 Compiler Error C2658 Compiler Error C2659 Compiler Error C2660 Compiler Error C2661 Compiler Error C2662 Compiler Error C2663 Compiler Error C2664 Compiler Error C2665 Compiler Error C2666 Compiler Error C2667 Compiler Error C2668 Compiler Error C2669 Compiler Error C2670 Compiler Error C2671 Compiler Error C2673 Compiler Error C2674 Compiler Error C2675 Compiler Error C2676 Compiler Error C2677 Compiler Error C2678 Compiler Error C2679 Compiler Error C2680 Compiler Err
• All times are UTC [ DST ] Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group. Color scheme by ColorizeIt!
FAQRSS FeedsLogo GuidelinesContact Us Register Login Cart Game Development Community What's New Blogs Resources Forums Compiling TLK 1.4 with VC++ 2005 Express by Michael Branin · in Torque Game Engine · 03/24/2006 (11:16 am) · 11 replies Anyone have a TLK 1.4 that will compile under Visual C++ 2005 Express? I can compile a Fresh Head of TGE with no issues what so ever but ... TLK will not compile at all. Torque Owner Michael Branin Default Studio Name About the author Recent Threads Blast back to the past Question about T2d 1.8 PhysicsEditor from the makers of TexturePacker Animations created friom multiple files Box2D, Torque and collisions T2D, Box2D, and you... NextNext Thread PrevPrevious Thread More from Torque Game Engine Login to reply to this thread Torque Owner Martin Askestad Martin's Games #1 03/24/2006 (12:33 pm) Yes. I found some instructions on how to compile Torque with C++ Express. And it worked. What problems are you having?? Torque Owner Michael Branin Default Studio Name #2 03/24/2006 (8:50 pm) I can compile Torque with no problems its the Lighting kit that I am having issues with heres some of the errors winWindow.cc ..\engine\platformWin32\winWindow.cc(33) : error C2440: 'initializing' : cannot convert from 'const wchar_t [22]' to 'const UTF16 *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast ..\engine\platformWin32\winWindow.cc(34) : error C2440: 'initializing' : cannot convert from 'const wchar_t [16]' to 'UTF16 [256]' There is no context in which this conversion is possible ..\engine\platformWin32\winWindow.cc(109) : error C2664: 'CreateMutexW' : cannot convert parameter 3 from 'UTF16 [512]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast ..\engine\platformWin32\winWindow.cc(134) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'UTF16 [1024]' to 'LPCWSTR' Types pointed to are unrelated; conversion requires reinterpret_ca