If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Error in registering windowsclass

The following code it taken from msdn library but it is failing to compile.
the following code has a header where all the variables used here are stored in header App.h.
please help me with this, i cannot really go further without this problem resolved.

Re: Error in registering windowsclass

Are you sure you copied the code correctly? In your other posts, you seem to take working code, and then turn it into non-working code.

but it is failing to compile. the following code has a header where all the variables used here are stored in header App.h. please help me with this, i cannot really go further without this problem resolved.

Please post "App.h".

That error probably happened since a WNDPROC cannot be a non-static member function. It must be a non-class or static class function. You are trying to assign a non-static member function pointer to a type that knows nothing about non-static class member functions.

In C++, a non-static member function and a global function are two totally different typess, even though they would seem to be the same thing.

Re: Error in registering windowsclass

Hey thanks, that was the problem,

i dont copy the code as it is, instead i will study once and write it so that i can traceback what went wrong, in this problem i was looking only at app.cpp, so could not resolve it.
thanks you your help

Re: Error in registering windowsclass

Then don't say that you got it from MSDN, as that makes MSDN look bad for no reason.

instead i will study once and write it so that i can traceback what went wrong,

If your goal is to learn Windows programming, then you take working code and run that first. Then you take the working code and you add to it, but not change the code so that you now break fundamental rules of C++.

It would seem you need to learn C++, not just Windows programming. The examples you are using assume you know C++ already -- if you go mess up the examples by writing faulty C++ code, then you're not going to get very far.

Re: Error in registering windowsclass

Ok sorry i understand,

Actually i studied c++, but soon i started to learn vc++ i am encountering many problems which i did not face while learning c++ in console application, that time i used codeblocks and was writing entire program in single file but i know that is not a good idea,

and i can see too many macros in vc++ and so many functions, i am often using "goto definition", but few times it wont help much, for example LoadString function, i am infact finding it difficult to learn at this point.

I was aware that only static functions can be called without using class object, yet i was not thinking about type of functions in app class, i know i am not an expert in c++, but i really want to learn windows programming at this point.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.