Hi everyone,

I have been creating simple vc dialog applications. However id like to start
creating applications with menus and dropdown boxes etc. What is the best
way of going about this? I heard of MFC. Is that the recommended path?

any help most appreciated
cheers,
john

Re: recommended way to create vc windows application by Abdo

Abdo
Tue Apr 11 13:05:56 CDT 2006

Either MFC, or you'll have to go with a .NET language (which may make things
a lot easier)
I don't know if there's any other third-party librarys, but I doubt they
would be any good than MFC...

--
Abdo Haji-Ali
Programmer
In|Framez

"John" <john@nospam.com> wrote in message
news:eFKv8EYXGHA.4924@TK2MSFTNGP05.phx.gbl...
> Hi everyone,
>
> I have been creating simple vc dialog applications. However id like to
start
> creating applications with menus and dropdown boxes etc. What is the best
> way of going about this? I heard of MFC. Is that the recommended path?
>
> any help most appreciated
> cheers,
> john
>
>



Re: recommended way to create vc windows application by Tom

Tom
Tue Apr 11 12:31:24 CDT 2006

One nice thing about MFC is that there is a ton of sample code and a lot of
for purchase libraries available. However, I agree that .NET is a good
alternative if you don't mind the slower execution speed and many DLL's
needed, you do get a lot of functionality and the nice managed code
paradigm. So many choices.

Tom

"Abdo Haji-Ali" <ahali@inframez.org_use_com_instead> wrote in message
news:%23aqQ5oYXGHA.1204@TK2MSFTNGP04.phx.gbl...
> Either MFC, or you'll have to go with a .NET language (which may make
> things
> a lot easier)
> I don't know if there's any other third-party librarys, but I doubt they
> would be any good than MFC...



Re: recommended way to create vc windows application by Arnaud

Arnaud
Tue Apr 11 15:42:08 CDT 2006

Abdo Haji-Ali wrote:
> Either MFC, or you'll have to go with a .NET language (which may make
> things a lot easier)
> I don't know if there's any other third-party librarys, but I doubt
> they would be any good than MFC...

Well, from my point of view, MFC is one of the worst native GUI libraries
for Windows out there ;-)
Although it has the great advantage of being widely used (which means
examples are easy to find), it's object model is really not up to date with
what is considered as best practices in C++ today. Possible alternatives are
WTL, Win32Gui, QT, etc... On the other hand, .NET is also a good
alternative, but it comes with a lot of tradeoffs (both positive and
negative).

Arnaud
MVP - VC



Re: recommended way to create vc windows application by Abdo

Abdo
Wed Apr 12 07:44:00 CDT 2006

> Well, from my point of view, MFC is one of the worst native GUI libraries
> for Windows out there ;-)
Just for the record, I don't like MFC either :)

> Although it has the great advantage of being widely used (which means
> examples are easy to find), it's object model is really not up to date
with
> what is considered as best practices in C++ today.
To name few...

> On the other hand, .NET is also a good
> alternative, but it comes with a lot of tradeoffs (both positive and
> negative).
The only negative tradeoff I can think of is the requirement of installing
the .NET framework, do you have another?

--
Abdo Haji-Ali
Programmer
In|Framez



Re: recommended way to create vc windows application by adebaene

adebaene
Wed Apr 12 08:51:10 CDT 2006


Abdo Haji-Ali a =E9crit :

> > On the other hand, .NET is also a good
> > alternative, but it comes with a lot of tradeoffs (both positive and
> > negative).
> The only negative tradeoff I can think of is the requirement of installing
> the .NET framework, do you have another?

- Learning curve
- higher memory footprint (on average)
- do not target lower-end OSes
- Just not as Fun as C++ ;-)

Arnaud
MVP - VC


Re: recommended way to create vc windows application by Dave

Dave
Fri Apr 14 10:29:06 CDT 2006

> Learning curve

Easier than most mainstream alternatives

> higher memory footprint (on average)

Trumped by cleaner and more stable code

> do not target lower-end OSes

Impacts almost nobody in the real world

> Just not as Fun as C++ ;-)

.NET has nothing to do with C++ (which most programmers are terrible at
anyway)



Re: recommended way to create vc windows application by Frederico

Frederico
Sat Apr 15 20:33:12 CDT 2006


"Dave Brown" <no_spam@_nospam.com> wrote in message
news:uaRYug9XGHA.1228@TK2MSFTNGP02.phx.gbl...
>> Learning curve
>
> Easier than most mainstream alternatives
>

I agree!

>> higher memory footprint (on average)
>
> Trumped by cleaner and more stable code
>

Disagree.... MS could build a better garbage collector... the way it is
implemented now sux...
And.... what's wrong with disposing resources you do not use anymore? Just a
simple "delete" will do!!

>> do not target lower-end OSes
>
> Impacts almost nobody in the real world
>

Not true... There is a lot of people still using Win9x and Win2k has a lot
of problems with .NET (as reported by my customers!)

>> Just not as Fun as C++ ;-)
>
> .NET has nothing to do with C++ (which most programmers are terrible at
> anyway)

To this I agree, too! :)

[]s
Fred



Re: recommended way to create vc windows application by Dave

Dave
Sun Apr 16 11:08:58 CDT 2006

>> Trumped by cleaner and more stable code
>>
>
> Disagree.... MS could build a better garbage collector... the way it is
> implemented now sux...
> And.... what's wrong with disposing resources you do not use anymore? Just
> a simple "delete" will do!!

The entire .NET framework is fundamentally easier to use than traditional
techniques like MFC or the raw WinAPI. This inherently leads to cleaner and
more stable code regardless of extranoues issues like garbage collection
(which actually works against your argument since countless numbers of
programmers don't properly release their resources)

>
>>> do not target lower-end OSes
>>
>> Impacts almost nobody in the real world
>>
>
> Not true... There is a lot of people still using Win9x and Win2k has a lot
> of problems with .NET (as reported by my customers!)

I wouldn't trust your customers to be the technical judge of whatever
problems they may be experiencing. It may have nothing to do with .NET. In
any case, MSFT retired their mainstream support for Win98 almost 4 years ago
and Win2K almost a year go. Countless consumers and probably most business
customers have now moved onto WinXP and Windows Server 2003 (or will be
doing so sooner rather than later). While people continue to use older
versions (Win2K in particular - Win98 is all but dead), Windows Vista is
almost on our doorstep now. Any new development should therefore target
existing and future versions of Windows without worrying about versions that
will almost be gone by the time your software is released.



Re: recommended way to create vc windows application by Frederico

Frederico
Sun Apr 16 12:14:15 CDT 2006


"Dave Brown" <no_spam@_nospam.com> wrote in message
news:uRGFVAXYGHA.428@TK2MSFTNGP02.phx.gbl...
>>> Trumped by cleaner and more stable code
>>>
>>
>> Disagree.... MS could build a better garbage collector... the way it is
>> implemented now sux...
>> And.... what's wrong with disposing resources you do not use anymore?
>> Just a simple "delete" will do!!
>
> The entire .NET framework is fundamentally easier to use than traditional
> techniques like MFC or the raw WinAPI. This inherently leads to cleaner
> and more stable code regardless of extranoues issues like garbage
> collection (which actually works against your argument since countless
> numbers of programmers don't properly release their resources)
>

If countless numbers of programmers MUST properly release their resources,
why there is a garbage collector after all?

Those guys probably are thinking: "Well... if there is a garbage collector,
why do I need to worry about garbage?!"... :)

>>
>>>> do not target lower-end OSes
>>>
>>> Impacts almost nobody in the real world
>>>
>>
>> Not true... There is a lot of people still using Win9x and Win2k has a
>> lot of problems with .NET (as reported by my customers!)
>
> I wouldn't trust your customers to be the technical judge of whatever
> problems they may be experiencing. It may have nothing to do with .NET.
> In any case, MSFT retired their mainstream support for Win98 almost 4
> years ago and Win2K almost a year go. Countless consumers and probably
> most business customers have now moved onto WinXP and Windows Server 2003
> (or will be doing so sooner rather than later). While people continue to
> use older versions (Win2K in particular - Win98 is all but dead), Windows
> Vista is almost on our doorstep now. Any new development should therefore
> target existing and future versions of Windows without worrying about
> versions that will almost be gone by the time your software is released.

Acordingly with MSDN MS .NET Framework 1.1 still runs on Win98!
This statistics about customers moving towards WinXP and Win2003 must be ok
with USA users, but not the rest of the world... Believe it or not there are
people still using Win3.11!!

This kind of argument makes linux folks crazy: Do I have to upgrade my
machine, my OS... spend a lot of money, just because MS refuses to makes
things right? Now I must have at least 512Mb of RAM and a 3.0GHz CPU just
because .NET... argh!

Try to run an average .NET app in a 64Mb machine!!!

[]s
Fred




Re: recommended way to create vc windows application by William

William
Sun Apr 16 13:20:43 CDT 2006

"Frederico Pissarra" <me@nowhere.net> wrote in message
news:eTrwtoXYGHA.3328@TK2MSFTNGP02.phx.gbl...
> This kind of argument makes linux folks crazy: Do I have to upgrade my
> machine, my OS... spend a lot of money, just because MS refuses to makes
> things right? Now I must have at least 512Mb of RAM and a 3.0GHz CPU just
> because .NET... argh!

It's a different mindset.

The overarching consideration on Linux is that the operating system cost
nothing.

On the other hand, for many of us, cost is not the only consideration. Not
only would I not use Windows 3.1 if it were free, even if it came with a
crisp new hundred dollar bill it wouldn't be enough to make a retreat to a
16-bit environment worthwhile.

Regards,
Will



Re: recommended way to create vc windows application by Dave

Dave
Sun Apr 16 14:18:17 CDT 2006

> If countless numbers of programmers MUST properly release their resources,
> why there is a garbage collector after all?
>
> Those guys probably are thinking: "Well... if there is a garbage
> collector, why do I need to worry about garbage?!"... :)

That's the point. With a garbage collector you don't have to worry about it.
If you rely on pure MFC or the WinAPI for instance then you do. Now you open
yourself up to resource leaks which is a serious problem among many C and
C++ programmers (and not just leaks - improper handling of resources
frequently leads to crashes or other serious problems).

> Acordingly with MSDN MS .NET Framework 1.1 still runs on Win98!
> This statistics about customers moving towards WinXP and Win2003 must be
> ok with USA users, but not the rest of the world... Believe it or not
> there are people still using Win3.11!!
>
> This kind of argument makes linux folks crazy: Do I have to upgrade my
> machine, my OS... spend a lot of money, just because MS refuses to makes
> things right? Now I must have at least 512Mb of RAM and a 3.0GHz CPU just
> because .NET... argh!
>
> Try to run an average .NET app in a 64Mb machine!!!

How do you expect MSFT to "make things right" for you? They're a
profit-based company, not a charity organization. You can't expect most
companies to support products 10 or 15 years after their initial release.
The very nature of software in particular makes the situation even more
difficult. It's easy to criticize MSFT and many people do. With many tens of
millions of lines of code to support however (Win2000 alone has between
30-60 million lines of code depending on your source), all the pundits who
like to complain couldn't do a better job if they were pulling the strings
themselves (in fact, most can't write more than a few dozen lines of code
without botching things up but complain loudly about incredibly complicated
mega-projects requiring hundreds of the world's best computer scientists to
get right).



Re: recommended way to create vc windows application by Arnaud

Arnaud
Mon Apr 17 04:30:36 CDT 2006

Frederico Pissarra wrote:
> "Dave Brown" <no_spam@_nospam.com> wrote in message
> news:uRGFVAXYGHA.428@TK2MSFTNGP02.phx.gbl...
>>>> Trumped by cleaner and more stable code
>>>>
>>>
>>> Disagree.... MS could build a better garbage collector... the way
>>> it is implemented now sux...
>>> And.... what's wrong with disposing resources you do not use
>>> anymore? Just a simple "delete" will do!!
>>
>> The entire .NET framework is fundamentally easier to use than
>> traditional techniques like MFC or the raw WinAPI. This inherently
>> leads to cleaner and more stable code regardless of extranoues
>> issues like garbage collection (which actually works against your
>> argument since countless numbers of programmers don't properly
>> release their resources)

The whole problem with .NET GC is that it doesn't manage all kind of
resources, only memory. All other resources (eg, files, kernel objects,
sockets, database connections....) must be managed manually, and the support
in .NET for easing this management (IDisposable) is far inferior IMHO to the
C++ alternative (the RAII idiom).

There is now a good alternative with C++/CLI and it's stack semantic, but I
fear it will stay away from "mainstream" .NET developpement wich is done in
C# or VB.

Arnaud
MVP - VC



Re: recommended way to create vc windows application by Tamas

Tamas
Wed Apr 26 13:42:09 CDT 2006

Arnaud Debaene wrote:

> The whole problem with .NET GC is that it doesn't manage all kind of
> resources, only memory. All other resources (eg, files, kernel objects,
> sockets, database connections....) must be managed manually, and the support
> in .NET for easing this management (IDisposable) is far inferior IMHO to the
> C++ alternative (the RAII idiom).

I completely agree. It solves 50% of the problems automatically, but
makes the other 50% even more painful than it was in native code. It's
almost unimaginable that recently designed modern systems no longer care
about proper resource management. Make no mistake, I'm not against
garbage collection, I just can't comprehend why solving some memory
management issues in an elegant way has to automatically lead to the
complete elimination of such a safe and successful concept as
deterministic destruction. It is clear that for resources and for
unmanaged memory management it is still preferred to use reference
counted smart pointers. Only that can't be implemented under .NET in a
portable way, because value types that use stack syntax don't support
copy constructors, and reference types that can have copy constructors
don't support deterministic destruction.

> There is now a good alternative with C++/CLI and it's stack semantic, but I
> fear it will stay away from "mainstream" .NET developpement wich is done in
> C# or VB.

C# has the using keyword, which is not as elegant as the C++/CLI stack
syntax, but it does the same job. The situation is bad in VB, though.

A big problem is that it's often very hard to guess from the name of the
class whether it requires a call to Dispose or not. You have to remember
whether the class is IDisposable, or simply a memory object.
Unfortunately a class' role may change during the development, and
something that used to be a pure-memory object may one day include a
resource. If nothing else, a native object, which automatically makes it
an IDisposable, but there is already 1000s of existing lines using the
object with the assumption that a simple garbage collection is enough.
How many times it happens in C++ that we make a simple class without a
destructor, but later as the project grows, a destructor will eventually
be added?

Another aspect is that not every resource is an "auto" variable inside a
function. There are cases when a resource needs to be passed into and
out of functions, and yet we need deterministic destruction. For those
cases C++ offers boost::shared_ptr, a reference counted smart pointer. I
would like to see a .NET way of doing that, preferably an implementation
that's a first class citizen in all languages, and can be passed from
one DLL to another.

It's not entirely out of place to store resources in containers,
especially if an object is a wrapper around an unmanaged class. One
could argue that real resources are not typically stored in containers,
but wrapping a native C++ class by definition makes the ref class
IDisposable, and thus a resource that requires much more than simple
garbage collection. Again, a reference counted smart pointer would do
wonders. How nice it would be if I could wrap unmanaged code into ref
classes using C++/CLI, and be able to pass it to C# and VB programmers,
without having to worry about resource management?

Yes, there is a concept called finalizer, but it's only called when the
system runs out of managed memory. The system may run out of native
memory much before the .NET framework realizes that a garbage collection
would be required, so the finalizer is an inferior solution compared to
a reference counted smart pointer for wrapped native objects.

To be completely fair, the problem of storing IDisposable objects in
.NET collections can be solved by writing special containers that take
care of calling delete/Dispose for each item. So I'm not saying that
resource management problems are impossible to solve in .NET. However, I
still reserve my statement that it's significantly more painful than in
modern ISO C++, and that the .NET framework doesn't provide any help
with that in its current state.

Tom