Jump to content
  • Advertisement
Sign in to follow this  
hothead

messagebox function not working

This topic is 5000 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!