Sign in to follow this  
hothead

messagebox function not working

Recommended Posts

its not working
//my first windows program

#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <windowsx.h>

//Winmain
int WINAPI WinMain(HINSTANCE hinstance,
				   HINSTANCE hprevinstance,
				   LPATR lpcmdline,
				   int ncmshow)
{
	//make a message box
	MessageBox(NULL, "My power is great",
					 "my first program",
					 MB_OK | MB_ICONEXXLAMATION);
	//end program!!
	return 0;
}
errors:
c:\Documents and Settings\matt\My Documents\Visual Studio Projects\gs\op.cpp(11) : error C2061: syntax error : identifier 'LPATR'
c:\Documents and Settings\matt\My Documents\Visual Studio Projects\gs\op.cpp(13) : error C2731: 'WinMain' : function cannot be overloaded
        c:\Documents and Settings\matt\My Documents\Visual Studio Projects\gs\op.cpp(9) : see declaration of 'WinMain'
c:\Documents and Settings\matt\My Documents\Visual Studio Projects\gs\op.cpp(17) : error C2065: 'MB_ICONEXXLAMATION' : undeclared identifie

Share this post


Link to post
Share on other sites
Looks like you've got some basic spelling mistakes: LPATR should probably be LPSTR and MB_ICONEXXLAMATION should probably be MB_ICONEXCLAMATION.

Share this post


Link to post
Share on other sites
Quote:
Original post by Alex Swinney
Looks like it's still not finding all those library files..

Are you using VC++ 6.0 or 7.0?

vc++7.0

Share this post


Link to post
Share on other sites
Quote:
Original post by hothead
Quote:
Original post by Alex Swinney
Looks like it's still not finding all those library files..

Are you using VC++ 6.0 or 7.0?

vc++7.0


Ok..

1) Goto Tools menu, click on Options.
2) Under the options dialog box, click on projects folder
3) Once there, click on VC++ Directories
4) Tell me all the directories that are listed on the right side (verbatim)

[EDIT]
You should have these listed: (where C: is your local hard drive)

C:\DXSDK\Lib
$(VCInstallDir)\lib
$(VCInstallDir)atlmfc\lib
$(VCInstallDir)PlatformSDK\lib\prerelease
$(FrameworkSDKDir)lib
[/EDIT]

Share this post


Link to post
Share on other sites
Quote:
Original post by Alex Swinney
Quote:
Original post by hothead
Quote:
Original post by Alex Swinney
Looks like it's still not finding all those library files..

Are you using VC++ 6.0 or 7.0?

vc++7.0


Ok..

1) Goto Tools menu, click on Options.
2) Under the options dialog box, click on projects folder
3) Once there, click on VC++ Directories
4) Tell me all the directories that are listed on the right side (verbatim)

[EDIT]
You should have these listed: (where C: is your local hard drive)

C:\DXSDK\Lib
$(VCInstallDir)\lib
$(VCInstallDir)atlmfc\lib
$(VCInstallDir)PlatformSDK\lib\prerelease
$(FrameworkSDKDir)lib
[/EDIT]

yeah it has those

Share this post


Link to post
Share on other sites
Quote:
Original post by Alex Swinney
Were they placed under 'Library Files'?

Here's a picture of what I mean, where the red arrow shows the types of files..

http://home.comcast.net/~aswinney14/lib.jpg

no were they supposed to be?Because I put them under executables.

Share this post


Link to post
Share on other sites
Quote:
Original post by hothead
nope that didn't fix it. [sad]


ok, switch from 'Library Files' to 'Include Files'. Do you see the same things there that you saw in 'Library Files'?

For instance, you should see:

C:\DXSDK\Inc

instead of

C:\DXSDK\Lib

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