|
Hi.
I posted a topic regarding GUI programming using C++ a week ago. I was wonder about the best tool to learn GUI programming using C++. Most members said MFC is the best tool to for GUI programming in Windows because of it is from Microsoft. However, many members said Qt is a much easier, and ultimately, more practically GUI tool in windows.
I bought a MFC book by Jess Prosise and I read the first chapter. I want to said MFC is challenging. First, I like the idea of having inherance and virtual functions and classes to control every specefic GUI feature. However, I am overwhelmed with the number of MFC classes and derived classes. There are too many classes to remember! There is not no way to really know the classes, their member functions, and the parameters for member functions.
I thought it over and decided to try Qt. From its interface, Qt look much easier than MFC because the GUI items are manageable via drag-drop. The negative side I Qt is *expensive*. It is too expensive (~$2k). Secondly, I do not think the free version Qt 2.3 is not Visual C++ .NET compatible.
Now I am basically left with MFC. Yes, it is intimidating me right now. I do not have problems with OOP. I am very comfortable with STL and enjoy using it to improve whatever I work on. MFC is different. Prosise present MFC as though I have to know everything about it as well as how Windows programs work. MFC is challenging to learn and implement at first.
Does it get easier and *faster*?
I am seriously considering using Borland C++ Builder. It has the RAD feature and I believe the GUI programming is similar to Qt. At least they look similar (drag-drop).
Kuphryn
|
|
|
|
|
Yes, it does get easier and faster.
There are many classes in MFC which you will use regularly, but far more you will not use often.
AppWizard and ClassWizard generate a lot of the code to get you started and ClassWizard is very useful when creating message maps and member variables bound to form controls. After a couple of weeks of playing with some sample code here and developing some simple apps, I think it will clear up for you.
I learned to use MFC before using STL and the win32 api. I had a crash course (develop an app or find other work) and was able to learn MFC and win32 api in 3 months. I did not learn it all, I just designed the app and then implemented it. At each step of the way I researched the proper way to implement it in MFC. Looking back on that first project (5+ years ago) it is not that pretty, but it is still in use by a well over 1000 users.
As far as RAD tools goes, there is a product from Capitol Solf (http://www.capitolsoft.com/) that can help here. I beleive it is not very expensive < $200 US. I do not use it, but some people I know do use it and like it very much.
Also, WndTabs (http://www.wndtabs.com) and Visual Assist can accelerate development (http://www.wholetomato.com/) also. WndTabs is free and Visual Assist is < $100 US.
Just my 2 cents.
Matt Gullett
|
|
|
|
|
kuphryn wrote:
Does it get easier and *faster*?
It's just like learning any difficult subject. Bury your nose in it until you understand it. After awhile, it will seem like second nature.
Jon Sagara
What about ?
|
|
|
|
|
It took me about 2 months to understand MFC well enough to use it effectively. By effectively I mean, it certianly helps having online reference and those popup tooltips. When you really get into a bind and you can't find anything like it, codeproject is just perfect.
If you know the WIN32 API, MFC is a snap!
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
Ask yourself, what do you hope to accomplish? If you are collaborating with others on a project, what you use will be restricted by what the others you work with can and do use. If you are working solo, you will have many more options. MFC is useful, in that it provides a (somewhat) consistant framework, and Visual Studio provides many wizards to help you... but this is most useful when the application you are writing falls into one of the categories Microsoft wrote MFC to be used for. If you need to throw something together in a hurry, C++ Builder, or even VB can be a better choice.
It does get easier, and somewhat faster. I've been using MFC for almost two years now, with no prior Windows programming experience, and still learning constantly. In hindsite, MFC would have been a lot easier to learn if i had been comfortable with the Win32 API prior to learning it; however, if i had been comfortable with the Win32 API, i prolly wouldn't have bothered. One of MFC's biggest advantages is that it often hides the ugly and inconsistent API; but this is also its biggest problem. Some of the hacks used to mask the differences between Windows and MFC are not exactly clear to beginners. The rest of MFC: database stuff, serialization, debugging, etc... can usually be done without. If you already use STL, you won't need to use the CMap, CArray, etc. classes for instance.
Wow, this is getting long... sorry . I guess my best advice would be, make sure you really need to use MFC before you jump in and start learning it. If you don't learn it now, but need to use it at some point in the future, it won't be hard to pick up. Just treat it like a geriatric family member: full of information, but much of it out-dated, incorrect, or forgotten. Respect it, but beware of senility.
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
Have you thought of learning WTL. It is fairly simple, very light-weight, and there are wrapper classes for just about every control in WIN32.
While it is not supported by Microsoft, it is free, and there is a very large development community that does support it.
|
|
|
|
|
Thanks for the inspirational comments.
I will definitely stick with MFC. I find it challenging, but one can easily master MFC with a lot of intensive reading, GUI design and MFC implementation. I will approach it that way.
I like MFC because it is from Microsoft. If I am going to design programming for Microsoft windows using C++, I might as well master a tool that is designed by the developers behind the OS for the OS.
Kuphryn
|
|
|
|
|
Thanks everyone.
I hear two sides including MFC is bloated and MFC is powerful once the developer learns its working. Both sounds valid.
One thing I see is MFC developers like MFC, while developers that user other GUI tools and/or are in the process of learning MFC seem criticize it. Both situations are understandable.
As I this topic reads, I find MFC challenging mainly because there are many specific "tweaks," which are difficult for a beginner to learn, design around, and implement.
As I said before, I will definitely go through this process and learn MFC. I will give all I got into Prosise book. My goal is to first finish reading the book. My goal is to gain as much insight as I possibly can throughout the process. It will take some time, but very doable.
Are there some tips you have for gaining the most insights as possible during the process of learning MFC? I learning C++ quick. I can certainly apply the same technique I used throughout the process of learning C++.
Thanks,
Kuphryn
|
|
|
|
|
Hi all,
How can i create a SQL Query in Access Database (.mdb), by CDaoDatabase::Execute ????
Help me
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Using CREATE PROCEDURE SQL command I guess. Look for description on it in your MS Access help
Philip Patrick
"Two beer or not two beer?" (Shakesbeer)
Web-site: www.saintopatrick.com
|
|
|
|
|
Hi again,
Thank you for introducing CREATE PROCEDURE statment to me ...
I read MS-ACCESS help, too.
But i have problem in using of this statment,
I wanna tell you my problem:
I have OPERATION table with below fields:
PID1(long) - PID2(long) - OP(boolean)
I wanna query in access database with below query:
SELECT PID1, OP, PID2 FROM OPERATION
UNION ALL
SELECT PID2, NOT OP, PID1 FROM OPERATION
I wrote below code but doesn't work:
MyDB.Execute( "CREATE PROCEDURE TempQuery [NUMBER1] LONG, [OP] LOGICAL, [NUMBER2] LONG AS SELECT PID1, OP, PID2 FROM OPERATION UNION ALL SELECT PID2, NOT OP, PID1 FROM OPERATION" );
I wrote it too but doesn't work:
MyDB.Execute( "CREATE PROCEDURE TempQuery AS SELECT PID1, OP, PID2 FROM OPERATION UNION ALL SELECT PID2, NOT OP, PID1 FROM OPERATION" );
What is my wrong ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Bah... did you tried to run your query in Access? Not in code? I just tried and see that Access don't know what is that CREATE PROCEDURE, it want to get only CREATE TABLE statements
I used Access 2000 for test
Philip Patrick
"Two beer or not two beer?" (Shakesbeer)
Web-site: www.saintopatrick.com
|
|
|
|
|
Thanks for your helps !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi.
I would like to know how to concatenate characters into a string that is an element of a vector.
For example:
string dataTemp("today");
std::vector<string> vecTemp;
vecTemp.push_back(dataTemp);
// I want to add characters into the tring element of vecTemp
vecTemp[0] += " is Saturday." // Is that right?
I would like vecTemp[0] to be "today is Saturday."
Thanks,
Kuphryn
|
|
|
|
|
Hi.
Let say there are two vectors, vectorA and vectorB.
-----------------------------------------------------
string dataTemp;
std::vector<string> vectorA, vectorB;
for (int = 0; i < 10; ++i)
{
dataTemp += i;
vectorA.push_back(dataTemp);
}
/* The loop above should produce vectorA to look something like this:
0
1
12
123
1234
12345
123456
1234566
12345678
123456789
*/
Okay, vectorB is empty.
I want to copy *specific* elements from vectorA to vectorB.
For example:
vectorB.push_back(vectorA[4]); // Is that right?
vecotrB.push_back(vectorA[8]);
Thanks,
Kuphryn
|
|
|
|
|
I need to Check the first char of a string
to see if it is A, B, or C
are there any methods
to do that?
thank you
|
|
|
|
|
Let say you have this:
string temp("February");
if (toupper(&temp[0]) == "A")
...
Try that first because I have not tested it.
Kuphryn
|
|
|
|
|
You can try the GetAt() function:
CString str;
char ch = str.GetAt(0);
switch (ch)
{
case 'A':
{
//do something based on char A
return result;
}break;
case 'B':
{
//do something based on char B
return result;
}break;
case 'C':
{
//do something based on char C
return result;
}break;
}
Hope that helps, if not let us know.
Cheers
Jay Beckert
|
|
|
|
|
C:\My Documents\DataStru\Investors.cpp(7) : error C2653: 'Investors' : is not a class or namespace name
can anyone tell me why does it give this error? PLEASE
i have "investors.h" included in investors.cpp but it's still giving me this error
thank you
|
|
|
|
|
|
hi
I have loaded a CComboBox object m_combo with the list of drives using DirDlgListComboBox.I also used SetCurSel(0) to display the first element
in the loaded list.Now i want to display all the loaded data when somebody clicks on the dropdown arrow.So i added an event CBN_DROPDOWN .In the handler i added this line of code
m_combo.ShowDropDown();
This gives an unhandled exception.I have just started MFC programming .So if anybody can tell me why this happens and also suggest me to make it work correctly.
|
|
|
|
|
Combo boxes will dropdown when you click on the arrow by default. You don't need any extra code to make this work.
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
CString *temp1 = new CString("");
LPTSTR str1 = temp1->GetBuffer(temp1->GetLength());
int ret=this->DlgDirListComboBox(str1,IDC_DIRCOMBO,0,DDL_DRIVES);
if(ret==0)
{
DWORD i=::GetLastError();
}
int n=m_list1.GetCount();
//m_combo.SetCurSel(1); //default data is not displayed in comboBox is this is not done.
ret=m_combo.GetLBTextLen(1);
m_combo.GetLBText(1,m_list);
m_list.Delete(0,2);
m_list.Delete(1,2);
ret = m_list.GetLength();
m_list+=":\\";
str1 = m_list.GetBuffer(m_list.GetLength());
ret=this->DlgDirList(str1,IDC_LIST1,0,DDL_EXCLUSIVE|DDL_DIRECTORY);
if(ret==0)
{
DWORD i=::GetLastError();
}
//LPCTSTR t = m_list;
//m_list1.AddString(t);
m_list1.SetCurSel(0);
n=m_list1.GetCount();
Invalidate();
m_list.ReleaseBuffer();
temp1->ReleaseBuffer();
delete temp1;
this is how i generate data in ComboBox
For the ComboBox the properties are Style 1.type = "dropdown" 2.Owner draw = " no".......the dropdown list doesnot display
can u help
|
|
|
|
|
I've just udated my computer to use winxp, but I'm finding that I can't visual c++ debug to work properly with it. I used the NT upgrade util, but it says that the header wont work with xp. So, when I debug it gives error messages. This problem can't be that uncommon - does anyone know the answer? Do I need a service pack somthing?
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
I'm running VC6 SP 5 on Windows XP and debugging without a problem. What error messages are you being shown?
Michael
|
|
|
|
|