By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,234 Members | 1,941 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,234 IT Pros & Developers. It's quick & easy.

Compiler error C2664

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a


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 discussion thread is closed

Replies have been disabled for this discussion.