|
I found writing a PACMAN game is a good starter...
John
|
|
|
|
|
Do you have any programming experience at all?
If you have none, then the first thing to do is learn a language. Start simple and learn the basics of your chosen language before even contemplating writing a game.
If you do have some coding experience then http://gamedev.net[^] is a good resource for learning about game development.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
Is it possible to set a few check buttons to be defaultly true so that when a user opens an applcation those buttons are by default true??
if it is how can we do that??
|
|
|
|
|
Try calling
CButton::SetCheck() in OnInitDialog() of your dialog class.
|
|
|
|
|
There is no window style to set to get your checkboxes set initially.
e.g. No BS_CHECKEDALREADY.
But its not hard to do this for yourself. If you use classwizard / DDX_Check,
just make sure your m_bAlreadySet = TRUE in your dialog constructor.
Or check the box manually in your OnInitDialog routine.
The possibilities may not be endless, but they are pretty large.
Iain
|
|
|
|
|
can u please give me exact code if I use class wizard /DDX_check?
I tried to declare a variable called m_Alreadyset to my check button of type BOOL and set it to true in OninitDialog, but it didn't work.
|
|
|
|
|
Hi,
Setting the BOOL variable to TRUE will work only before! a call to DoDataEcxhange.
So you must set your variable to TRUE before the line CDialog::OnInitialUpdate();
or call UpdateData(false); at the end of your OnInitialUpdate-Routine.
You may also consider doing the assignment in your dialog's constructor.
Regards
G. Steudtel
|
|
|
|
|
You'll need a member variable mapped to each of the checkboxes. Then in OnInitDialog() , simply call the SetCheck() method of each member variable.
m_checkbox1.SetCheck(BST_CHECKED);
m_checkbox2.SetCheck(BST_UNCHECKED);
m_checkbox3.SetCheck(BST_CHECKED);
...
|
|
|
|
|
Some possibilities have already been given to you.
If you use classwizard, you can assign a member variable of type BOOL to a check box.
Doing this will fill in all the right code for you. As I remember (I don't touch CW
with a barge pole) you can even assign an initial value of 1 (TRUE) to it. If not,
all you have to do is find the line in the constructor which initialises the check
variable and change it to say = 1; or = TRUE; depending on taste.
If you want to do it the hard way, then the following code will help. Is assume you
have a check box of value IDC_CHECK1, and you are making a dialog class called CMyDlg.
In the header:
class CMyDlg : public CDialog
{
public:
CMyDlg (....);
....
BOOL m_bCheckValue;
....
protected:
void DoDataExchange (CDataExchange *pDX);
BOOL OnInitDialog ();
....
};
In the implementation file (eg. mydlg.cpp)
CMyDlg (...) : CDialog (....)
{
....
m_bCheckValue = TRUE;
....
}
BOOL CMyDlg::OnInitDialog ()
{
....
BOOL bReturn = CDialog::OnInitDialog ();
....
return bReturn;
}
void CMyDlg::DoDataExchange (CDataExchange *pDX)
{
CDialog::DoDataExchange (pDX);
....
DDX_Check (pDX, IDC_CHECK1, m_bCheckValue);
....
}
I put in the OnInitDialog just to remind you you need to call the base member to ensure DoDataExchange
gets called.
By putting the DDX_Check in, rather than just checking the box in OnInitDialog, we make sure that
the value is retrieved when you press OK, so you can find out whether the user cleared the check box
or not.
Iain.
|
|
|
|
|
Make sure the member variable for the checkbox is a control variable, not value...then you can use SetCheck()
|
|
|
|
|
In C++ if I provide the function and declaration at once is it automatically inline ?
|
|
|
|
|
If it is a member function, yes. For global functions you have to add the inline keyword.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
It's not guaranteed to be inline. It depends on the compiler.
|
|
|
|
|
The MSDN doc's [^] give a list of cases where the compiler can't inline, even if you specify forceinline.
The two of note are :
- default debug builds
- virtual methods
In either case the compiler will generate a normal function call.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi!
I've created an SDI application with MFC. I want to add a splash screen during the loading of my program, to hide the main frame while loading and show it when the application has finished starting.
In my App class InitInstance function, I've deleted the two following lines:
<br />
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);<br />
m_pMainWnd->UpdateWindow();<br />
But my main frame is still visible. How to hide it while my application is starting?
Thks in advance!
Appstmd
http://www.appstmd.com
|
|
|
|
|
Check Mike Dunn's C++ FAQ[^] question 7.6, maybe it is applicable to your case.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
you could call your splash screen before the main frame is displaed
you could place this at the start OnNewDocument() function
si
|
|
|
|
|
|
Hi guys
There is a limit in the number of controls in a dialog?
There is a way to pass this number?
I was making a copy apste until the paste had less controls than the copy, then I thought that it was a limit
Best regards
Dr.pi
|
|
|
|
|
What's the point ?
~RaGE();
|
|
|
|
|
Practical answer: No, there is no limit.
Real answer: There are limits, but they're BIG ones.
A dialog box is just a window. Controls on the box are just child windows. So the limit is the
upper limit on HWNDs imposed by windows. As I remember, Win95 had a limit of 8 or 16 thousand.
Windows NT (which 2000 and XP are, despite the names) are only limited by memory. So you can have
a few million if you like.
There are earlier practical limitations though...
1) You have to be able to see them. 1 pixel x 1 pixel controls help noone. So you are generally limited
to several hundred by the screen.
2) You have to able to design it. The resource editor may well have limitations. You could use a
text editor instead, but do you have that much patience?
3) You have to be able to identify most of the controls. Window ID numbers are not infinite...
(GetDlgCtrl (UINT id)...)
The mind boggles as to WHY you care about the upper limit. Usability will kill your design
long before windows does.
Iain.
|
|
|
|
|
Hi Iain
Then maybe the limitation is more in the resource editor than in the Visual C++?
Best Regards
Dr.Pi
|
|
|
|
|
Last I knew, this limit was 255 (or 256). There is no limit when creating the controls dynamically, however. If you've the need for that many, it's better to consider a tabbed-dialog.
|
|
|
|