| View previous topic :: View next topic |
| Author |
Message |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Mon Aug 25, 2008 12:18 pm Post subject: Missing specifier type int assumed. |
|
|
Hey,
I've tried and tried to figure out why the following code fails, but am not sure. I've posted the entire thing here along with errors:
http://pastebin.com/m4e2849b5
I'm sure I'm doing a few things wrong. Thanks for the help.
-waffles
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Mon Aug 25, 2008 12:20 pm Post subject: |
|
|
try
#include <Windows.h>
#include <Commctrl.h>
#include <Tchar.h>
instead of using " "
Also whats with the random extern?
_________________
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Mon Aug 25, 2008 12:35 pm Post subject: |
|
|
| You are trying to initialize a variable already declared outside a block of code.
|
|
| Back to top |
|
 |
nog_lorp Grandmaster Cheater
Reputation: 0
Joined: 26 Feb 2006 Posts: 743
|
Posted: Mon Aug 25, 2008 12:54 pm Post subject: |
|
|
All his code is in static context instead of in a function...
At line 51 in the pastebin insert | Code: | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow
) {
|
at the end of the C source insert
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish |
|
| Back to top |
|
 |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Mon Aug 25, 2008 1:47 pm Post subject: |
|
|
This isn't the whole sources. Essentially, I've enclosed the createwindows in a function that will be called in main.cpp to make the GUI creation less messy in teh main source file.
EDIT: Here is all my code along with the errors posted below:
http://pastebin.com/m4213e766
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Mon Aug 25, 2008 2:05 pm Post subject: |
|
|
Line 54 says
| Code: | | #include "childwindow.h". Take that out. |
|
|
| Back to top |
|
 |
WafflesFTW Expert Cheater
Reputation: 0
Joined: 21 Mar 2008 Posts: 131
|
Posted: Mon Aug 25, 2008 2:09 pm Post subject: |
|
|
| I get massive errors when i do.
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Mon Aug 25, 2008 2:19 pm Post subject: |
|
|
Opps. I was confused for a sec.
Try:
1.for now, move #include "childwindows.h" from Main.h to main.cpp and tell me what happens.
Last edited by kitterz on Mon Aug 25, 2008 2:29 pm; edited 1 time in total |
|
| Back to top |
|
 |
nog_lorp Grandmaster Cheater
Reputation: 0
Joined: 26 Feb 2006 Posts: 743
|
Posted: Mon Aug 25, 2008 2:24 pm Post subject: |
|
|
Waffles, you are having scope problems. Your use of extern is faulty.
In childwindows.h, you declare "extern HWND hWnd". Since childwindows.h is included by both childwindows.cpp and main.cpp, they both expect an HWND hWnd to show up in some other object.
In your WinMain, hWnd is a local parameter, meaning it does not take up the roll of your extern. Simplest fix (not necessarily best) is to change the name of extern HWND hWnd, assign to that when you do CreateWindowEx, and change all references to hWnd in CreateChildWindows to the new name.
Then you can declare HWND hWnd2 or w/e in either source file.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish |
|
| Back to top |
|
 |
|