Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Missing specifier type int assumed.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
WafflesFTW
Expert Cheater
Reputation: 0

Joined: 21 Mar 2008
Posts: 131

PostPosted: Mon Aug 25, 2008 12:18 pm    Post subject: Missing specifier type int assumed. Reply with quote

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
View user's profile Send private message AIM Address
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon Aug 25, 2008 12:20 pm    Post subject: Reply with quote

try

#include <Windows.h>
#include <Commctrl.h>
#include <Tchar.h>

instead of using " "

Also whats with the random extern?

_________________
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Mon Aug 25, 2008 12:35 pm    Post subject: Reply with quote

You are trying to initialize a variable already declared outside a block of code.
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Mon Aug 25, 2008 12:54 pm    Post subject: Reply with quote

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
Code:
return 0; }

_________________
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
View user's profile Send private message
WafflesFTW
Expert Cheater
Reputation: 0

Joined: 21 Mar 2008
Posts: 131

PostPosted: Mon Aug 25, 2008 1:47 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Aug 25, 2008 2:05 pm    Post subject: Reply with quote

Line 54 says

Code:
#include "childwindow.h". Take that out.
Back to top
View user's profile Send private message Send e-mail
WafflesFTW
Expert Cheater
Reputation: 0

Joined: 21 Mar 2008
Posts: 131

PostPosted: Mon Aug 25, 2008 2:09 pm    Post subject: Reply with quote

I get massive errors when i do.
Back to top
View user's profile Send private message AIM Address
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Aug 25, 2008 2:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Mon Aug 25, 2008 2:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites