Error C2664 In C
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 error c2664 cannot convert parameter more about Stack Overflow the company Business Learn more about hiring developers or posting error c2664 cannot convert parameter 1 from ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community error c2664 lpcwstr Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up error C2664: cannot convert parameter 1 from 'int' to 'int
Error C2664 Cannot Convert Argument
[]' up vote 0 down vote favorite #include
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 error c2664 in visual c++ Us Learn more about Stack Overflow the company Business Learn more about hiring developers
Error C2664 Visual Studio
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack
Error C2664 Cannot Convert Parameter 1 From 'const Char *' To 'char *'
Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up error C2664: cannot convert parameter 1 from http://stackoverflow.com/questions/22150353/error-c2664-cannot-convert-parameter-1-from-int-to-int 'X' to 'X' up vote 1 down vote favorite I have a C++/Win32/MFC project in Visual Studio 2008, and I'm getting a strange error message when I compile it. I've created a small project to demonstrate the problem, and the main code is #ifndef _MyObject_h #define _MyObject_h class MyObject { public: MyObject() { } }; #endif // _MyObject_h // --- END MyObject.h // --- BEGIN ObjectData.h http://stackoverflow.com/questions/14713648/error-c2664-cannot-convert-parameter-1-from-x-to-x #ifndef _ObjectData_h #define _ObjectData_h template
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 http://stackoverflow.com/questions/25254938/c2664-error-c-visual-studio Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the https://bytes.com/topic/c/answers/63040-compile-error-c2664-why Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up C2664 error c++ Visual Studio up error c2664 vote 0 down vote favorite I am trying to modify an old MFC program. After opening the project in Visual Studio 2013 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 error c2664 cannot 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 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 str
and get tips & solutions from a community of 418,505 IT Pros & Developers. It's quick & easy. Compile error C2664 - Why?? P: n/a David Hoffman When I compile it, I get a "error C2664: 'ExtractID' : cannot convert parameter 1 from 'char' to 'char []'" error and I don't understand why. I am just learning C++, so keep it simple. One more note, I have the program compiled using strings instead of char[]; however, I should be able to convert all my strings to char[] and get the program to compile. Right? Here is my code. Thanks. // Written by David Hoffman // Sept 30, 2003 #include