need help with error

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: May 2007
Posts: 18
Reputation: sadaka is an unknown quantity at this point 
Solved Threads: 0
sadaka sadaka is offline Offline
Newbie Poster

need help with error

 
0
  #1
May 28th, 2007
Hello, I'm a new programmer and wanted to create a simple windows application. I might be getting in a little over my head when writing the code below. All seems well when compiling the code without implementing classes. When I implemented the class AppEngine from a separate source file I had these errors that I could not resolve. I came to two conclusions of what I was doing wrong and was hoping that someone could point me in the right direction.

Conclusion 1 - I incorrectly included the source files during compile
Conclusion 2 - I was in over my head and should not attempt windows programming just yet.

The errors I'm receiving are:
Line 12 : new types may not be defined in a return type
Line 4 : requires init-declaration before LRESULT WindowProcedure

I use DEV C++ IDE and these the codes that gets the error.

1 #include <windows.h>
2 #include "DCPPPClasses.h"
3
4 LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT 5 message, WPARAM wParam, LPARAM lParam);
6
7 AppEngine *_pAE;
8
9 _pAE = new AppEngine(HINSTANCE, LPSTR, LPSTR, WORD, 10 WORD, int, int);
11
12 int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevi, 13 LPSTR szcmdline, int icmdshow)
14 {
15 }

I would like to know what those error means and how to fix them. Thanks in advance. Sadaka
If poking it with a stick doesn't work for you. Try poking it with a bigger one.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 1,066
Reputation: Sturm is on a distinguished road 
Solved Threads: 24
Sturm's Avatar
Sturm Sturm is offline Offline
Veteran Poster

Re: need help with error

 
-1
  #2
May 28th, 2007
how bout using a better api? qt or gtk are much easier.
"Hey ass, don't hijack my thread. This is serious." -JoshSCH
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: need help with error

 
0
  #3
May 29th, 2007
line 4: LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT 5 message, WPARAM wParam, LPARAM lParam);
line 9: _pAE = new AppEngine(HINSTANCE, LPSTR, LPSTR, WORD, 10 WORD, int, int);

these are the errors. the compiler/ide you are using seems to emit very poor error messages.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: need help with error

 
0
  #4
May 29th, 2007
also line 12: int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevi, 13 LPSTR szcmdline, int icmdshow)
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 2,979
Reputation: niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute niek_e has a reputation beyond repute 
Solved Threads: 308
Moderator
Featured Poster
niek_e's Avatar
niek_e niek_e is offline Offline
Cenosillicaphobiac

Re: need help with error

 
0
  #5
May 29th, 2007
That's what you get when you copy-paste code... De lines got messed up, and now the linenumbers are in your code:
In line 4: Remove '5'
In line 9: Remove '10'
In line 12: Remove '13'

Regards Niek
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 18
Reputation: sadaka is an unknown quantity at this point 
Solved Threads: 0
sadaka sadaka is offline Offline
Newbie Poster

Re: need help with error

 
0
  #6
May 29th, 2007
I added the numbers to indicated the line. I thought it would help indicate which line generated the errors. I figured that I included the external source files incorrectly and that the complier didn't recognize any of my class calls hence error : new types may not be define in a return type. I want to know what that error means because I tried everything I could think of to resolve it but in vain. Next time I'll just attach my source files so there won't be any confusions. Sorry. Thanks again in advance.
Things aren't always what it seems my young grasshopper...
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: need help with error

 
0
  #7
May 30th, 2007
check the header DCPPPClasses.h for a missing ; at the end of the class, mismatched (), {} etc.
line 9: _pAE = new AppEngine(HINSTANCE, LPSTR, LPSTR, WORD, 10 WORD, int, int); is an obvious error on many counts.
Last edited by vijayan121; May 30th, 2007 at 2:47 am.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 18
Reputation: sadaka is an unknown quantity at this point 
Solved Threads: 0
sadaka sadaka is offline Offline
Newbie Poster

Re: need help with error

 
0
  #8
Jun 10th, 2007
oh yes duh... i'm such a dueche bag that's what I left out after the class. Thanks alot bro. i've attached my source if you want to look them over. Thanks again. I've also made changes to the class and added the colon (. Think that I can attach stuff?
A good deed will not go unnoticed. -Sun Tsu
Attached Files
File Type: cpp DCPPP4.cpp (3.8 KB, 0 views)
File Type: h DCPPP4.h (2.4 KB, 0 views)
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum


Views: 1301 | Replies: 7
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC