473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Compiler error C2664

Hi,

I've been struggling with this error for a while and I don't
know what's wrong. Any help would be appreciated.
Here's code snippets and the error message.

----------------------------
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam, LPARAM lParamClient, HWND _hClient);
----------------------------
class WindowClass: public WNDCLASSEX
{
public:
WindowClass (WNDPROC WndProc, char const * className,
HINSTANCE hInst, const char * szChild)
{
....
)
};
----------------------------
// This is the line that gives the error
WindowClass winClass (WndProc, className, hInst, szChild);
----------------------------
error C2664: '__thiscall WindowClass::WindowClass(long (__stdcall *)
(struct HWND__ *,unsigned int,unsigned int,long),const char *,
struct HINSTANCE__ *,const char *)' : cannot convert parameter 1 from '
long (struct HWND__ *,unsigned int,unsigned int,long,struct HWND__ *)'
to 'long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'
None of the functions with this name in scope match the target type
----------------------------

I hope you understand my snippets. I'll try to explain more if needed.
I'm using Visual C++ 6.0 for coding.
Jul 23 '05 #1
1 2527


mkarja wrote:
Hi,

I've been struggling with this error for a while and I don't
know what's wrong. Any help would be appreciated.
Here's code snippets and the error message.

----------------------------
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam, LPARAM lParamClient, HWND _hClient);
----------------------------
class WindowClass: public WNDCLASSEX
{
public:
WindowClass (WNDPROC WndProc, char const * className,
HINSTANCE hInst, const char * szChild)
{
....
)
};
----------------------------
// This is the line that gives the error
WindowClass winClass (WndProc, className, hInst, szChild);
----------------------------
error C2664: '__thiscall WindowClass::WindowClass(long (__stdcall *)
(struct HWND__ *,unsigned int,unsigned int,long),const char *,
struct HINSTANCE__ *,const char *)' : cannot convert parameter 1 from '
long (struct HWND__ *,unsigned int,unsigned int,long,struct HWND__ *)'
to 'long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long)'
None of the functions with this name in scope match the target type
----------------------------

I hope you understand my snippets. I'll try to explain more if needed.
I'm using Visual C++ 6.0 for coding.


WndProc isn 't declared with the right number of arguments...

David
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Alf P. Steinbach | last post by:
// As usual the error message directs one to the report the bug. // // And as usual there is absolutely no way to do so without paying for // the privilege... // // Or using three or four hours...
9
by: Stuart Carnie | last post by:
Due to the tightening of the VC++ compiler in 2005, I have run into a compiler error (from code that previously worked in 2003) using a CComPtr<ITypeLib> as an element of a std::list, as follows...
0
by: Arne Adams | last post by:
Hi, the following yields an internal compiler error with VC7.1 struct Nix { template<class T> operator T()const { return T(); } };
9
by: i | last post by:
#include<stdio.h> #include<conio.h> #include<process.h> #include<string.h> char ch; int n,m; void main(); char check(int,int,char); void cash(int,int,char); void debit_card(int,int,char);
1
by: td0g03 | last post by:
I have no idea why am I getting an error C2664: 'parseInput' : cannot convert parameter 2 from 'main::WORD_STRUCT ' to 'struct WORD_STRUCT ' #include <stdio.h> #include <stdlib.h> #include...
4
by: ayan4u | last post by:
HBITMAP patternBMP =NULL; patternBMP = (HBITMAP)LoadImge(hInstance, "bitmap.bmp", IMAGE_BITMAP,0,0,LR_LOADFROFILE); getting a compiler error error C2664: 'LoadImageW' : cannot convert...
1
by: misu101 | last post by:
Hi, I have a VS 6 project and I am trying to compile it using VS 2005. My program has the atlbase.h include which seems to trigger the errors. It used to compile OK using VS 6. The include...
0
by: FrankCheung | last post by:
I am using VS 2005 c++ ReportViewer to generate a dynamic report with a date filter. The following is the code contained in the form.h: public: void SetReportParameters() { ...
5
by: slizorn | last post by:
well the error i get is the title above: error C2664: 'searchTree' : cannot convert parameter 2 from 'const char *' to 'char' error is form this line searchTree(treeObj->root ,data1.c_str());...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.