MFC or Win32 API? - Programmer
This is a discussion on MFC or Win32 API? - Programmer ; Hi all,
I'm struggling with a project I have, I'm a complete newbie to windows
programming, I've done a little console programming and feel OK with that.
My problem is that I need to learn so I'm looking for books ...
-
MFC or Win32 API?
Hi all,
I'm struggling with a project I have, I'm a complete newbie to windows
programming, I've done a little console programming and feel OK with that.
My problem is that I need to learn so I'm looking for books and I'd decided
on the well reviewed 'programming windows' or 'programming windows with
MFC'. Now I cant choose which to get. The first is based on C, not C++, and
the second is MFC based and I'm not sure MFC is right for me?
Obviously only I can choose ultimately but what would you learn - Win32 or
MFC, knowing a couple of points:
1)I got to get this project under way ASAP really, I've spent enough time
learning the basics of C++.
2)I have a timing-critical serial comms side to the app I reckon may need
multithreading.
3)Windows might not be able to cope with the timing issue, especially if I
wanted realtime operation (this is a robot controller package I'm creating.)
so I'd like to be able to shift it over to linux should the need arise.
Another problem is that not only do I not know about windows APIs and MFC
etc, but I also am not sure of what i need to know, if that makes sense! Its
a huge task for me, coming from a mechanical engineering background!
Cheers
James
-
Re: MFC or Win32 API?
Sorry, I forgot to mention, this is a means-to-an-end sort of thing. I'd
like to be able to do the task I require, I'm not learning for fun so I am
trying to do this in as little time as possible but still keep options open.
I've thought about wxWindows for portability which would be perfect but
learning to deal with those requires knowledge of the basics (Win32 or MFC?)
so I'm stumped. In a bit of a downer at the moment thinking I'll never get
off the ground.
James
-
Re: MFC or Win32 API?
Coyoteboy wrote:
> Hi all,
>
> I'm struggling with a project I have, I'm a complete newbie to windows
> programming, I've done a little console programming and feel OK with that.
> My problem is that I need to learn so I'm looking for books and I'd decided
> on the well reviewed 'programming windows' or 'programming windows with
> MFC'. Now I cant choose which to get. The first is based on C, not C++, and
> the second is MFC based and I'm not sure MFC is right for me?
> Obviously only I can choose ultimately but what would you learn - Win32 or
> MFC, knowing a couple of points:
> 1)I got to get this project under way ASAP really, I've spent enough time
> learning the basics of C++.
> 2)I have a timing-critical serial comms side to the app I reckon may need
> multithreading.
> 3)Windows might not be able to cope with the timing issue, especially if I
> wanted realtime operation (this is a robot controller package I'm creating.)
> so I'd like to be able to shift it over to linux should the need arise.
>
> Another problem is that not only do I not know about windows APIs and MFC
> etc, but I also am not sure of what i need to know, if that makes sense! Its
> a huge task for me, coming from a mechanical engineering background!
>
> Cheers
> James
>
>
I'm going to suggest MFC, especially because you said "under way ASAP."
You get a fully functioning app with a few clicks of the mouse
because the MFC skeleton projects produced by the wizard let you skip a
lot of dull stuff.
Yes, you're going to need multithreading to handle the serial comms.
The MTTTY sample code in MSDN has formed the basis of the serial threads
for me in several projects.
Neither the MFC nor the API approach has a chance of helping you port to
linux. You're unlikely to have a timing problem unless you're looking
for responses of a few milliseconds or less.
It won't take long to try the MFC Scribble tutorial, or the equivalent
chapter in the "Programming Windows with MFC" book, to see how it fits.
Give it a try.
--
Scott McPhillips [VC++ MVP]
-
Re: MFC or Win32 API?
"Scott McPhillips [MVP]" wrote in message
news:2_6dnbG_FKkS9pPdRVn-uw@comcast.com...
>
>
> I'm going to suggest MFC, especially because you said "under way ASAP."
> You get a fully functioning app with a few clicks of the mouse
> because the MFC skeleton projects produced by the wizard let you skip a
> lot of dull stuff.
>
> Yes, you're going to need multithreading to handle the serial comms.
> The MTTTY sample code in MSDN has formed the basis of the serial threads
> for me in several projects.
>
> Neither the MFC nor the API approach has a chance of helping you port to
> linux. You're unlikely to have a timing problem unless you're looking
> for responses of a few milliseconds or less.
>
> It won't take long to try the MFC Scribble tutorial, or the equivalent
> chapter in the "Programming Windows with MFC" book, to see how it fits.
> Give it a try.
>
> --
> Scott McPhillips [VC++ MVP]
Hi Scott,
Thanks for that - very helpful advice. Think I'm settled on MFC, and I've
just bought the book so I should be under way soon with any luck. I'll have
a look at those tutorials now cheers. I've read a few online tutorials and a
paper that suggested that MFC was best for threading as it was easier to
make synchronise etc so I'm all fired up ready to rock 
Timing-wise im looking at down to about 25-28ms I believe, my supervisor
suggested this may be a little close to call but its worth a try and I'm
sure the practice will come in handy in case I have to pass it over to
linux - god help me learning a new OS too lol!
Thanks again,
James