473,800 Members | 2,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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::Wi ndowClass(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 2560


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::Wi ndowClass(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
3558
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 to find the _current_ reporting page... #include <vector> #include <iostream>
9
4652
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 std::list<CComPtr<ITypeLib> >. I understand the problem, so am looking for the correct solution to my problem. On the line that attempts to call push_back, I receive "error C2664: 'std::allocator<_Ty>::construct' : cannot convert parameter 1...
0
1039
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
2959
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
3431
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 <string.h> #define FILENAME 80 #define MAX_SIZE 1000 #define CHAR_SIZE 200
4
3289
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 parameter 2 from 'const char ' to 'LPCWSTR' but it should take an array of charecter for the name of the bitmap....it should work but it is not....don't know why!!!!1
1
5129
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 path is: C:/Program Files/Microsoft Visual Studio 8/VC/include;C:/Program Files/Microsoft Visual Studio 8/VC/atlmfc/include;C:/Program Files/Microsof t Visual Studio 8/SDK/v2.0/include;C:/Program Files/Microsoft Visual Studio...
0
1369
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() { ReportParameter^ DatePara = gcnew ReportParameter("ShowDate",this->datepick->Value.ToString()); this->reportViewer1->LocalReport->SetParameters( gcnew array<ReportParameter^>{DatePara});
5
5398
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()); i have also attached searchTree below for yr reference
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9090
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7580
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.