View previous topic :: View next topic |
Author |
Message |
Potato-VS- Registered User
Joined: 16 Jul 2002 Location: Ontario Canada Posts: 1562
|
Posted: Fri Dec 13, 2002 3:43 pm Post subject: Making a Windows program - I NEED HELP! |
|
|
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 |
|
|
Mongoose_Slayer Registered User
Joined: 23 Feb 2002 Location: Wisconsin Posts: 1582
|
Posted: Fri Dec 13, 2002 3:45 pm Post subject: |
|
|
/me is confused |
|
Back to top |
|
|
Vulcan Registered User
Joined: 29 Dec 2001
Posts: 2773
|
Posted: Fri Dec 13, 2002 6:12 pm Post subject: |
|
|
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 |
|
|
Potato-VS- Registered User
Joined: 16 Jul 2002 Location: Ontario Canada Posts: 1562
|
Posted: Fri Dec 13, 2002 6:50 pm Post subject: |
|
|
It still gives me some errors though....
[RS]Potato-VS- |
|
Back to top |
|
|
Vulcan Registered User
Joined: 29 Dec 2001
Posts: 2773
|
Posted: Fri Dec 13, 2002 6:55 pm Post subject: |
|
|
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 |
|
|
Potato-VS- Registered User
Joined: 16 Jul 2002 Location: Ontario Canada Posts: 1562
|
Posted: Fri Dec 13, 2002 7:40 pm Post subject: |
|
|
Thanks, Im going to go through these tuts.
[RS]Potato-VS- |
|
Back to top |
|
|
Potato-VS- Registered User
Joined: 16 Jul 2002 Location: Ontario Canada Posts: 1562
|
Posted: Sat Dec 14, 2002 7:29 am Post subject: |
|
|
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 |
|
|
cobra Server Admin
Joined: 18 Apr 2002 Location: having fun with Loka and Tickles! Posts: 6806
|
Posted: Sat Dec 14, 2002 8:45 am Post subject: |
|
|
[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 |
|
|
Lin Sivvi Defiant Hero Registered User
Joined: 17 Jan 2002 Location: Some small boring city Posts: 1205
|
Posted: Sat Dec 14, 2002 10:02 am Post subject: Re: Making a Windows program - I NEED HELP! |
|
|
[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 |
|
|
ToRaK Registered User
Joined: 08 Feb 2002 Location: North Carolina Posts: 1105
|
Posted: Sat Dec 14, 2002 10:02 am Post subject: |
|
|
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 |
|
|
Lin Sivvi Defiant Hero Registered User
Joined: 17 Jan 2002 Location: Some small boring city Posts: 1205
|
Posted: Sat Dec 14, 2002 10:16 am Post subject: |
|
|
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 |
|
|
Potato-VS- Registered User
Joined: 16 Jul 2002 Location: Ontario Canada Posts: 1562
|
Posted: Sat Dec 14, 2002 1:12 pm Post subject: |
|
|
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 |
|
|
Lin Sivvi Defiant Hero Registered User
Joined: 17 Jan 2002 Location: Some small boring city Posts: 1205
|
Posted: Sat Dec 14, 2002 1:26 pm Post subject: |
|
|
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 |
|
|
Potato-VS- Registered User
Joined: 16 Jul 2002 Location: Ontario Canada Posts: 1562
|
Posted: Sat Dec 14, 2002 1:53 pm Post subject: |
|
|
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 |
|
|
ToRaK Registered User
Joined: 08 Feb 2002 Location: North Carolina Posts: 1105
|
Posted: Sat Dec 14, 2002 3:33 pm Post subject: |
|
|
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 |
|
|
|