I'm currently on my fifth attempt on classes, and this one's looking more hopeful than any other one I've tried so far
Here's my bind...Constructors:
I read that I can make more than one constructor:
This is in my Game.h file:
Code:
class Game
{
public:
Game(void);
Game(HINSTANCE *hInstance);
~Game(void);
private:
HINSTANCE MainInstance;
}
My Game.cpp file consists of:
Code:
#include "Game.h"
#using <mscorlib.dll>
Game::Game();
{
//This one's empty because I never want to use it
}
Game::Game(HINSTANCE *hInstance)
{
MainInstance = hInstance;
Fullscreen = GetScreenMode();
InitWindow();
}
Game::~Game(void)
{
//Haven't gotten here yet
}
And finally, my Main Coding CPP (Main.cpp) consists of this:
Code:
#include "Game.h"
int APIENTRY WinMain(HINSTANCE MyInstance, HINSTANCE PrevInstance, LPSTR kposzArgs, int nWinMode)
{
MSG Msg;
Game(&MyInstance) MyGame;
//Ignore the part beneath here, I'm concerned about the above
while(GetMessage(&Msg, NULL, 0, 0))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}
Now, you may be looking at this and thinking "What in the world is he trying to do?" Which is okay. Because I get a few errors when I try to compile
So, the questions:
1) (Main.cpp)How do I specify which Constructor to use when I declare the MyGame variable?
Hmm...I guess that's it I have many errors, but I think figuring this one out will be able to solve a good portion of them. So for now, yeah I appreciate any help.