|
MFC has a more complete application framework. For example, the menu handling and tying menu items to button bar buttons.
Once you understand MFC and Visual Studio, it is very easy to rapidly create applications.
MFC has a massively huge amount of third party resources for it. CodeJock, for example, is an excellent UI interface (far better, IMO, than the BCG stuff Microsoft used for the 2008 Feature Pack.)
With few exceptions, MFC lets you seamlessly move between native Win32 and the framework.
MFC/Native applications [can] use much less memory than .NET applications.
MFC did languish for several years, then Microsoft did some actual research of actual developers and found that as of 2003/2004, 80% of client application developers world wide was still using MFC. As a result, they are paying attention again and for 2010 are allegedly adding back the fabulous Class Wizard from Visual C++ 6 and before. As for efficiencies; due largely to the heavy amount of COM added, it's become more bloated, but it's hard to make it much more efficient without changing the design (and even then, for large applications, the difference would be negligible.)
At one point WTL showed promise, but it was rather confusing and time consuming to create window classes. Unfortunately, rather than add some Wizards and beef up support, Microsoft threw WTL into the public domain. (Shame since I have shipping applets which could have been main leaner with WTL.)
Many (please note that I didn't say all) developers I personally know who claim .NET is superior to MFC were never very good at MFC; they never bothered to really learn it or Win32. Most of those are just as bad at .NET too; they just think they aren't. I use native Win32, MFC, and .NET. Many things are easier in .NET, some things are harder and some things are so blasted hard, it's just not worth it. There are some really nice things about .NET and C#, but when all is said and done, I'm a C/C++ programmer at heart. (Having said all that; anyone who needs to do web development or pure database front ends would be crazy to pick C++ over .NET.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi,
May i know how can i create a Slider Control with three ranges...ie
1--------2---------3
based on the movement ie if the slider is at 1 i need to display a static text as low(and need to set some registry also)and if 2 it should display medium AND 3 as high..
Please let me know regarding the same...
|
|
|
|
|
So what exactly is the problem? Have you called the SetRange(1, 3, TRUE) method, or sent the control a TBM_SETRANGE message?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hello all,
I am having problems with opening a device defined serial port using basic CreateFile function. The serial port is specific to a framegrabber installed in the PC. I can open and communicate with it with no problems in windows hyper terminal and evne in Matlab, but not able to open it in VC++. Usually with other framegrabber I can see all the additional com ports installed by the framgrabber under COM&LPT ports in device manager, but not with this board. But in registry under HKLM\HARDWARE\DEVICEMAP\SERIALCOMM, I see these ports listed.
The port names are not as usual COM1 etc, its with X64-CL_iPro_1_Serial_0/X64-CL_iPro_1_Serial_1 names.
Can anyone help me out here.... or does anyone know how windows hyper terminal opens these ports..
thanks,
PKNT
|
|
|
|
|
Hi
I am using something like,
char des[10];
char src[2] = "Hello";
strcpy(des, sizeof(des), src);
Because this application is going to be internationalized, i want WCHAR or UNICODE format implemented.
So will that make any change to calling sizeof(des)?
Do i need to do soemthing like, sizeof(des) * sizeof(char) ??
|
|
|
|
|
wchar_t buf1[80], buf2[80];
wcscpy_s(buf1, _countof(buf1), buf2);
You might want to read the documentation[^]
|
|
|
|
|
led mike wrote: You might want to read the documentation[^]
That's optional, isn't that?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Of course! Many developers just wave their magic wand keyboard at the problem. 
|
|
|
|
|
Hello I am working on some code and came across this
void *orpGetValue(char *key, SceSize *key_size)
{
void *value = NULL;
.....
.....
by using the void with the * infront of the name, the code will allow the passing of a pointer
that will allow the calling routine to assigned it to any variable type.
What is this called, I have been googling and can not find any info.
I know it is commonly used.
Thank you in advance.
|
|
|
|
|
|
Does the * refer to it is a pointer to a VOID and that the return can be used to reference an int or a string?
I googled kludge, but didn't see any C references to it 
|
|
|
|
|
it's sometimes called a "generic" pointer. the caller is expected to know what the pointer is really pointing to.
|
|
|
|
|
Thank you!
I googled it and have found lots of info now. 
|
|
|
|
|
I'd call it type-erasure really. You're removing all semblance of type information...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I would like to create a template class that takes two template parameters:
1) A typename parameter, T
2) A pointer to a template function, F, that has the following declaration
template<typename U>
U DoSomething(int arg) { ... } With such a declaration, I would like to instantiate my template class as follows:
MyTemplateClass<int, &DoSomething<SomeType>> myInstance; Is there some way to declare MyTemplateClass such that I can infer the typename of SomeType? I have tried the following two cases but receive a compile error for both:
template<typename T, template <typename U> U (*F)(T)>
template<typename T, U (*F<typename U>)(T)> I know that I could add a third template parameter, but would prefer to avoid it if at all possible. Thanks for any assistance,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
No. DoSomething is not a type - it's a function. You're passing a value in, but for a class template, you need to have pre-declared those types.
Sorry and all that, but I don't think there's any way around it.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
when im trying to use...
CDialogTemplate dlt;
LPCTSTR ID=_T("IDD_TESTDLG_DIALOG");
if (!dlt.Load(ID)) return -1;
the issue is eventhough the ID is correct but the above if statement returns -1
but if i use
if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1;
the above statement doesn"t return -1..
Please help me regarding the same...
|
|
|
|
|
p_1960 wrote: if (!dlt.Load(MAKEINTRESOURCE(CTestDlg::IDD))) return -1;
You might change this to:
LPTSTR ID2 = MAKEINTRESOURCE(CTestDlg::IDD);
if (! dlt.Load(ID2)) return -1; and use the preprocessor's output to see if ID2 contains a different value that ID .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks for ur Reply David ....
but the issue is with the below lines..
CDialogTemplate dlt;
LPCTSTR ID=_T("IDD_TESTDLG_DIALOG");
if (!dlt.Load(ID)) return -1;
the above code is returning -1 which is undesirable because ID is correct...
the issue is i have id as String like _T("IDD_TESTDLG_DIALOG")(ie im getting the ID of the resource as a String instead of CTestDlg::IDD) ...
Please correct me if im wrong....
|
|
|
|
|
The point of the exercise was to compare the two (i.e., ID vs. ID2 ). MAKEINTRESOURCE() is a macro that the preprocessor will expand, which is why I suggested a temporary variable.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
ya..but MAKEINTRESOURECE converts an integer value to a resource type ...
but in the case of
CDialogTemplate dlt;
LPCTSTR ID=_T("IDD_TESTDLG_DIALOG");
if (!dlt.Load(ID)) return -1;
i need to pass id as String instead of integer...the doubt it is not working is i send id as
string...
Sorry for inconvenience caused ....
|
|
|
|
|
p_1960 wrote: ya..but MAKEINTRESOURECE converts an integer value to a resource type ...
It returns a LPTSTR .
p_1960 wrote: i need to pass id as String instead of integer...the doubt it is not working is i send id as
string...
Did you look at the preprocessor's output?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
ya it"s not recognising the ID which sent as string but it is working fine if i pass ID AS
integer..
Pls let me know...
|
|
|
|
|
p_1960 wrote: ya...
So what is its output?
p_1960 wrote: ...it"s not recognising the ID which sent as string but it is working fine if i pass ID AS
integer..
Pls let me know...
You may want to re-read this thread to understand exactly what it is that I am asking of you.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Dialog name IDs should be either a string or a 16-bit unsigned integer.
If you remove dialog id definition (#define IDD_TESTDLG_DIALOG number) from the file named "resource.h", it will work. Or you should enter that name with double quotes (like "IDD_TESTDLG_DIALOG") as dialog ID of dialog properties.
|
|
|
|