Skip to main content
gamedev.net
🔒 Locked

messagebox function not working

Started by hothead 11 replies 2.8k views
Original Post
hothead
hothead
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

SiCrane
SiCrane
Looks like you've got some basic spelling mistakes: LPATR should probably be LPSTR and MB_ICONEXXLAMATION should probably be MB_ICONEXCLAMATION.
hothead
hothead
it got rid of those three errors but now its saying cannot open file 'd3d9.lib'
Alex Swinney
Alex Swinney
Looks like it's still not finding all those library files..

Are you using VC++ 6.0 or 7.0?
I WISH SOMEONE WOULD FIX THE DAMNED LOGIN!
hothead
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
Alex Swinney
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]
I WISH SOMEONE WOULD FIX THE DAMNED LOGIN!
hothead
hothead
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
Alex Swinney
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
I WISH SOMEONE WOULD FIX THE DAMNED LOGIN!
hothead
hothead
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.
Alex Swinney
Alex Swinney
Yes, sorry if I failed to mention this earlier!

Change it to Library, then type it in there.

That should fix your problem!
I WISH SOMEONE WOULD FIX THE DAMNED LOGIN!
Alex Swinney
Alex Swinney
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
I WISH SOMEONE WOULD FIX THE DAMNED LOGIN!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.