Sign in to follow this  
Idono87

Quick error question

Recommended Posts

I'm learning the win32 api and i keep getting errors at one of my function prototypes where i'm trying to pass a reference variable of type POINT.

here are the the error messages.

[b]error C2143: syntax error : missing ')' before '&'
error C2143: syntax error : missing '{' before '&'
error C2059: syntax error : '&'
error C2059: syntax error : ')'[/b]

Prototype
[code]HWND CreateButton(HWND hwnd, wchar_t* name, int identifier, POINT& pt);[/code]


The function.
[code]HWND CreateButton(HWND hwnd, wchar_t* name, int identifier, POINT &pt)
{
....
}[/code]

I've played around referencing both classes and structs 20 min befor i wrote this post. Just incase i missunderstood something and massivly failed. They worked and compiled perfectly.

Question is what i'm doing wrong.

Share this post


Link to post
Share on other sites
That exact code compiles fine under VS2010

I would suspect a project setting, what IDE are you using?

Share this post


Link to post
Share on other sites
[quote name='yewbie' timestamp='1311265805' post='4838501']
That exact code compiles find under VS2010

I would suspect a project setting, what IDE are you using?
[/quote]

I'm using VS2010 Ultimate.

Share this post


Link to post
Share on other sites
[quote name='SiCrane' timestamp='1311266237' post='4838508']
Are you sure you're compiling as C++ and not as C?
[/quote]

Haha. Simple as that.
Never had that problem befor :/

Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this