Questions tagged [c2664]

C2264 is a Compiler Error that occurs when one tries to pass a function a parameter of an incompatible type.

C2264 is a Compiler Error that occurs when one tries to pass a function a parameter of an incompatible type.

This example generates C2264:

// C2664b.cpp
// C2664 expected
struct A {
   // To resolve, uncomment the following line.
   // A(int i){}
};

void func( int, A ) {}

int main() {
   func( 1, 1 );   // No conversion from int to A.
}
52 questions
0
votes
1 answer

VS2017 C++ compiler error C2664 can not convert argument

Using VS2017 I compile the code below using the unicode character set STDMETHODIMP Load(LPCOLESTR lpwszFileName, const AM_MEDIA_TYPE *pmt) { TCHAR *szExtension = PathFindExtension(lpwszFileName); and I get the following error error C2664: 'LPSTR…
Maverick
  • 837
  • 7
  • 24
0
votes
0 answers

emplace_back different definitions

I'm using emplace_back function in a cpp project in visual studio and it works correctly. Visual studio shows following definition for it: void std::vector::emplace_back(CHAR(&_Val)[1]) Then, I'm going to move my cpp…
Mahdi
  • 435
  • 3
  • 13
  • 32
0
votes
1 answer

When I run the C++ code, I always get Visual Studio error C2664

When I use this code if (GetKeyNameText(Key << 16, NameBuffer, 127)) { KeyName = NameBuffer; GoodKeyName = true; } I get the following error C2664 'int GetKeyNameTextW(LONG,LPWSTR,int)': cannot convert argument 2 from 'char [128]' to…
Hanzki
  • 1
  • 1
  • 3
0
votes
1 answer

Compiler error C2664 on 64 bit platform

I have a program that compiles and runs using win 32 platform in Visual Studio 2012. After changing the platform to X64, it gives the following error message: " test_integration.cpp(27): error C2664: 'hcubature_v' : cannot convert parameter 2 from…
R. Simon
  • 3
  • 2
0
votes
1 answer

error C2664: 'send' : cannot convert parameter 2 from 'ServerGreeting' to 'const char *'

I'm beginner on C++ and I'm porting a C code (TWAMP RFC5357) to a new project (IPSLA RFC 6812) and I facing this problem: When I try to use the function send, I see the error "error C2664: 'send' : cannot convert parameter 2 from 'ServerGreeting' to…
0
votes
0 answers

C2664 showing up only in release configuration

I'm trying to build a program for release, but even though it works fine in a debug configuration, I am getting this error when I use the release configuration: 1>c:\users\owner.ben-pc\documents\visual studio 2010\projects\xsp quick unpacker\xsp…
0
votes
2 answers

Error C2664 compiling DLL based on old crypto++ library

I'm not a C++ programmer and i'm just trying to compile an old DLL (VS6 I think) in VS2010 based on the crypto++ library for the purpose of debugging it to find out how it works as I have to write some code in another language to be able to read…
user3173234
  • 11
  • 1
  • 5
0
votes
1 answer

error C2664 - Need help and clarification

I have the COM compnent ( dll ) ThirdParty defined the interface and some COM class ThirdPartyObjectClass implementing this interface. I have the appropriate files ThirdParty.h and ThirdParty_i.c allow to compile it in C++. IThirdParty { …
Yanshof
  • 8,974
  • 14
  • 81
  • 168
0
votes
2 answers

C++ MFC error C2664

I'm trying to make a simple window using c++ and mfc. the following code is taken from the book "Visual C++ and MFC Fundamentals" but it doesn't work. I get error C2664:BOOL CFrameWnd::Create(LPCTSTR,LPCTSTR, ... ) cannot convert argument 2 from…
user3443903
0
votes
2 answers

C2664 Cannot Convert Parameter

I am implementing this code but i am receiving an error. http://curl.haxx.se/libcurl/c/ftpupload.html The error is in this bit of code. static size_t read_callback(void *ptr, size_t size, size_t nmemb, void *stream) { curl_off_t nread; /* in…
WebSight
  • 490
  • 8
  • 23
0
votes
2 answers

Managed C++ Error C2664

I have this struct: #pragma once #include "Defines.h" #ifndef _COLOR_H_ #define _COLOR_H_ namespace BSGameFramework { namespace Graphics { ref struct Color { public: Color(BYTE r, BYTE g, BYTE b); …
ThomasSquall
  • 179
  • 13
0
votes
1 answer

c++ cannot convert parameter

I am trying to insert rectangle objects to a tree. This is the implementation of insert function. void TwoDimTree::insertNewNode(Rectangle dataIn) { insertNewRectangleUtility((&tree), dataIn); } void…
irem
  • 3
  • 2
0
votes
1 answer

C2664 conversion error

I am a beginner in programming language and need your help. I have got codes from C language which is needed to be written into C++ MFC. In C language I have codes like int32 float64 and when I put them into MFC application, they showed this…
Ashton
  • 73
  • 1
  • 3
  • 12
0
votes
2 answers

Error C2664 , need clarification

I use this function in my programm and I call it by receive(&head);.I am doing something wrong and get an error c2664 : cannot convert parameter 1 from "link **" to "link *" when calling QUEUEget(&head). If I understand it right (*head) is a link to…
user2192519
  • 31
  • 1
  • 1
  • 6
0
votes
2 answers

error C2664 due to cdecl and myclass conflict

I'm trying to join an old piece of code in C to my present VC++ project: // .h class DMSinv : public CDialog { double finte(double z); double ITFStolz(double Zp1, double Zp2, double Zc); }; // .cpp double Zcglob; …
madoro
  • 55
  • 7