Jump to content
  • Advertisement
Sign in to follow this  
bikola_p

Good Short, MFC tutorials

This topic is 4556 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, just posting as im sick of coding for a little black console screen, i want to move to windows, i looked at win32 message handling etc, and understand it, got sick of it, then moved to MFC, i got the basics of that, and now want to do the fun stuff. I want tutorials which show me how to use listboxs', checkboxs', edit box, the whole lot. After googling, i got some functionx.com site, all i gotta say about their tuts is that they suck coke. I click listbox, and the damn tutorial goes through a whole application, which barely even looks into listbox. Any link would be good.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
http://www.codersource.net/mfc_tutorial_Part1.html
thats the firts tutorial. on the bottom of the page are links to other mfc tutorials. click around and you most probably will find what your looking for.

Share this post


Link to post
Share on other sites
no, that link is sort off win32 type, it starts talking about the code off the par, doesnt mention a thing about the controls. Anything more control's based?ANyone

Share this post


Link to post
Share on other sites
I looked on those tutorials, and they are pretty good in describing the basics of the controls. For instance, this tutorial. In order to create a listbox, you must create a dialog, then create a listbox in it, then use the classwizard to map a member variable of class CListBox(which isn't too far from Win32 API, it's more like a thin layer that anything else) to the control, then map window messages to overriden member functions in order to handle events. That's what the tutorial describes, and that's how MFC works(I don't like it at all, btw). The tutorial also describes how to do certain tasks, like inserting& deleting items or responding to user selections, so I'd say it has what you need. If you want documentation for all functions of CListBox, you can check MSDN.

If you find MFC too "difficult" for your tastes, you can develop for the .NET platform and the Windows Forms technology, which allows you to just drag&drop controls in a form, edit their properties and handle events in a much easier way, and not worry about Win32 API at all. Visual Studio 2005 Express is free for download in the Microsoft site.

Share this post


Link to post
Share on other sites
You should check out the MFC section at The Code Project. The people writing articles there are usually quite knowledgable.

Just don't post programming questions in the Lounge. :)

Share this post


Link to post
Share on other sites
Ok, thanks alot, i read quiet a bit, and im getting the hang of it. While im on the topic in the beginners forum. I would like to ask, what i may be doing wrong.

First, i put in 3 different editboxs. After hitting Ctrl-W, i added seperate variables of type Cstring to the edit box's so i have
IDC_EDITBOX1 variable m_add1
IDC_EDITBOX2 variable m_add2
IDC_RESULT variable m_result

OK, that was simple, So, i put in a button control. And double clicked it.
in their i put the following code.

void CCtalculatorDlg::OnButton1()
{
double digit1, digit2, result;

digit1 = atof(m_add1);
digit2 = atof(m_add2);

result = digit1 + digit2;

m_result.Format(result);
UpdateData(FALSE);

}



I complile with 0 errors, 0 warnings. When i run it i get some error.
DEGBUG ASSERTION FAILED!
strex.h
line 701
Press retry to debug application
and get options to ABORT, RETRY, or IGNORE.
What did i do wrong?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!