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.
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.
Last edited by Paul McKenzie; January 28th, 2013 at 04:57 PM.
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
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.
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.
Thank you, i am really getting help much needed at this point.
Last edited by pavankn18; January 29th, 2013 at 09:30 AM.