FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Making a Windows program - I NEED HELP!
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    The Ville.org Half-Life Gaming Community Forum Index -> General Ramblings
View previous topic :: View next topic  
Author Message
Potato-VS-
Registered User


Joined: 16 Jul 2002
Location: Ontario Canada
Posts: 1562

PostPosted: Fri Dec 13, 2002 3:43 pm    Post subject: Making a Windows program - I NEED HELP! Reply with quote

Okay, Im going to make a mod of the Genesis 3D game engine, but I want to get use to windows programming first. I have made a simple MSDOS program with little dialogue boxes and stuff... I try to compile to code below and I get an error - thanks MSVC++ for not telling me what the error is!

Anyway, here is the code... Maybe one of you guys could fix it up or something...

// Nemesis 3D.cpp
//

#include <windows.h>

//a nice simple introduction to the program
//

int WinMain(HINSTANCE, hInstance, LPSTR);
{
MessageBox(NULL, "Hello! Welcome to Nemesis 3D!", "Welcome!");
return 0;
}

//other program stuff goes below
//
Back to top
View user's profile Send private message Send e-mail
Mongoose_Slayer
Registered User


Joined: 23 Feb 2002
Location: Wisconsin
Posts: 1582

PostPosted: Fri Dec 13, 2002 3:45 pm    Post subject: Reply with quote

/me is confused
Back to top
View user's profile Send private message Send e-mail
Vulcan
Registered User


Joined: 29 Dec 2001

Posts: 2773

PostPosted: Fri Dec 13, 2002 6:12 pm    Post subject: Reply with quote

I would guess no semicolin after the main statement.
_________________
I need to make a sig, but I don't have the time. Maybe I will eventually.
Back to top
View user's profile Send private message
Potato-VS-
Registered User


Joined: 16 Jul 2002
Location: Ontario Canada
Posts: 1562

PostPosted: Fri Dec 13, 2002 6:50 pm    Post subject: Reply with quote

It still gives me some errors though....

[RS]Potato-VS-
Back to top
View user's profile Send private message Send e-mail
Vulcan
Registered User


Joined: 29 Dec 2001

Posts: 2773

PostPosted: Fri Dec 13, 2002 6:55 pm    Post subject: Reply with quote

try here, I don't know if it will help, but it might.
_________________
I need to make a sig, but I don't have the time. Maybe I will eventually.
Back to top
View user's profile Send private message
Potato-VS-
Registered User


Joined: 16 Jul 2002
Location: Ontario Canada
Posts: 1562

PostPosted: Fri Dec 13, 2002 7:40 pm    Post subject: Reply with quote

Thanks, Im going to go through these tuts.

[RS]Potato-VS-
Back to top
View user's profile Send private message Send e-mail
Potato-VS-
Registered User


Joined: 16 Jul 2002
Location: Ontario Canada
Posts: 1562

PostPosted: Sat Dec 14, 2002 7:29 am    Post subject: Reply with quote

Heres the errors that I get.

--------------------Configuration: Nemesis 3D - Win32 Debug--------------------
Compiling...
Nemesis 3D.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D\Nemesis 3D.cpp(9) : error C2061: syntax error : identifier 'hInstance'
C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D\Nemesis 3D.cpp(10) : warning C4007: 'WinMain' : must be '__stdcall'
C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D\Nemesis 3D.cpp(10) : error C2731: 'WinMain' : function cannot be overloaded
C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D\Nemesis 3D.cpp(9) : see declaration of 'WinMain'
Error executing cl.exe.

Nemesis 3D.exe - 2 error(s), 1 warning(s)

[RS]Potato-VS-
Back to top
View user's profile Send private message Send e-mail
cobra
Server Admin
Server Admin


Joined: 18 Apr 2002
Location: having fun with Loka and Tickles!
Posts: 6806

PostPosted: Sat Dec 14, 2002 8:45 am    Post subject: Reply with quote

[RS]Potato-VS- wrote:
Heres the errors that I get.

--------------------Configuration: Nemesis 3D - Win32 Debug--------------------
Compiling...
Nemesis 3D.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D\Nemesis 3D.cpp(9) : error C2061: syntax error : identifier 'hInstance'
C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D\Nemesis 3D.cpp(10) : warning C4007: 'WinMain' : must be '__stdcall'
C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D\Nemesis 3D.cpp(10) : error C2731: 'WinMain' : function cannot be overloaded
C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D\Nemesis 3D.cpp(9) : see declaration of 'WinMain'
Error executing cl.exe.

Nemesis 3D.exe - 2 error(s), 1 warning(s)

[RS]Potato-VS-


damn that are a lot off errors!!!!
_________________
PROUD TO BE A MEMBER OF =US-V= & VILLE $UPPORTER
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Lin Sivvi Defiant Hero
Registered User


Joined: 17 Jan 2002
Location: Some small boring city
Posts: 1205

PostPosted: Sat Dec 14, 2002 10:02 am    Post subject: Re: Making a Windows program - I NEED HELP! Reply with quote

[RS]Potato-VS- wrote:
#include <windows.h>


int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hprev, PSTR cmdline, int ishow)
{
MessageBox(NULL, "Hello! Welcome to Nemesis 3D!", "Welcome!");
return 0;
}



Try that
Back to top
View user's profile Send private message Send e-mail AIM Address
ToRaK
Registered User


Joined: 08 Feb 2002
Location: North Carolina
Posts: 1105

PostPosted: Sat Dec 14, 2002 10:02 am    Post subject: Reply with quote

I think you probably should start with a samller projeckt and work your way up...

edit: linny poo what is your new sn?
_________________
The most hated.
Back to top
View user's profile Send private message Send e-mail AIM Address
Lin Sivvi Defiant Hero
Registered User


Joined: 17 Jan 2002
Location: Some small boring city
Posts: 1205

PostPosted: Sat Dec 14, 2002 10:16 am    Post subject: Reply with quote

None, I don't really bother using trillian anymore. I'm not on gamesnet much either. But I'll connect for you
Back to top
View user's profile Send private message Send e-mail AIM Address
Potato-VS-
Registered User


Joined: 16 Jul 2002
Location: Ontario Canada
Posts: 1562

PostPosted: Sat Dec 14, 2002 1:12 pm    Post subject: Reply with quote

Okay, one error now...

C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D.cpp(14) : error C2660: 'MessageBoxA' : function does not take 3 parameters

Geeze, why can't his be easy?

[RS]Potato-VS-
Back to top
View user's profile Send private message Send e-mail
Lin Sivvi Defiant Hero
Registered User


Joined: 17 Jan 2002
Location: Some small boring city
Posts: 1205

PostPosted: Sat Dec 14, 2002 1:26 pm    Post subject: Reply with quote

MessageBox(NULL, "Hello! Welcome to Nemesis 3D!", "Welcome!", 0);

Takes 4 params, the last is the style, 0 should be just an OK button.
Back to top
View user's profile Send private message Send e-mail AIM Address
Potato-VS-
Registered User


Joined: 16 Jul 2002
Location: Ontario Canada
Posts: 1562

PostPosted: Sat Dec 14, 2002 1:53 pm    Post subject: Reply with quote

Now it says that the first { is causing an error,

C:\Program Files\Microsoft Visual Studio\MyProjects\Nemesis 3D.cpp(15) : error C2447: missing function header (old-style formal list?)

Should I use the win32 sdk to help me with this? Maybe it will help MSVC++ understand some of these terms...

[RS]Potato-VS-
Back to top
View user's profile Send private message Send e-mail
ToRaK
Registered User


Joined: 08 Feb 2002
Location: North Carolina
Posts: 1105

PostPosted: Sat Dec 14, 2002 3:33 pm    Post subject: Reply with quote

Look kido, it seems to me that you would be much better served taking a couple of simpler projects first off. If you are hell bent on writting a full fledged "windows" game or whatever then I would suggest you get a book which will help you along.
_________________
The most hated.
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    The Ville.org Half-Life Gaming Community Forum Index -> General Ramblings All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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


Powered by phpBB © 2001, 2005 phpBB Group