Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Win32 & MFC

0 views
Skip to first unread message

Marcus

unread,
Nov 9, 1999, 3:00:00 AM11/9/99
to
Hi all,

I have a standard win32 app, using standard Dlls & stuff. I have declared
windows.h and stuff. Now, I want to use some MFC things... in particular the
CSocket and CAsyncSocket classes, this requires the declaration of
afxsock.h. The compiler pukes on this, complaining that I should not include
windows.h ... even tho I have removed every instance of windows.h from my
code. I have used windows.h in mfc apps before without complaint, which
makes me think that perhaps I'm missing a compiler directive or something...
any ideas?

I'd prefer not to rewrite my code as MFC as I only want to use one or two
classes from the MFC libraries.

cheers,

M

Tim Ebben

unread,
Nov 9, 1999, 3:00:00 AM11/9/99
to
The CSocket and CAsyncSocket classes create objects derived from CWnd. These
require the MFC messaging scheme and the instantiation of an application
object. You cannot use these classes without including <afxwin.h> and
re-designing the app to use MFC. You can write a fairly thin MFC app wrapper,
but you have to at least use CWnd for your windows.

You can use things like CString and CMap from MFC without an app object. In
that case you would include <afx.h>, and that would tell you what features you
can and can't use.

--
Timothy J. Ebben
Levon's Wake, Inc.
Email: T...@LevonsWake.com
Web: www.LevonsWake.com

----- Paul Bunyan - Best damn logger there EVER was!

Marcus wrote in message <808ve0$1b...@newton.cc.rl.ac.uk>...

Trapper

unread,
Nov 9, 1999, 3:00:00 AM11/9/99
to
A way of doing this is to use the MFC app wizard and check the box that
states Windows Sockets in step 4 of 6.

Marcus <m.p...@rl.ac.uk> wrote in message
news:808ve0$1b...@newton.cc.rl.ac.uk...

Marcus Webster

unread,
Nov 12, 1999, 3:00:00 AM11/12/99
to
Instead of using MFC's WinSock implementation, which (IMHO) is pants. Try using
the WinSock API wrapper classes available on CodeGuru:

http://www.codeguru.com/network/winsockapi_wrappers.shtml

I have used them myself, when the MFC ones just didn't cut the mustard.

Marcus W

John A. Grant

unread,
Nov 12, 1999, 3:00:00 AM11/12/99
to
Marcus Webster wrote in message <382BDA9E...@barlowwilson.com>...

>Instead of using MFC's WinSock implementation, which (IMHO) is pants. Try
using

"pants"? Can you translate please? :) Good? Bad? Cool?

--
John A. Grant * I speak only for myself * (remove 'z' to reply)
Radiation Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here


Marcus Webster

unread,
Nov 15, 1999, 3:00:00 AM11/15/99
to
pants = A derogatory term in popular* use in the UK at the moment.
( i.e. The new David Bowie single is pants. French beef fed on
sewage is pants...etc..etc )

Marcus W

*I don't expect the Queen to be using it in her address to the Commonwealth in
Durban, nor am I aware of the BBC using it in their news reports.

John A. Grant

unread,
Nov 15, 1999, 3:00:00 AM11/15/99
to
Marcus Webster wrote in message <382FCD1A...@barlowwilson.com>...

>pants = A derogatory term in popular* use in the UK at the moment.
> ( i.e. The new David Bowie single is pants. French beef fed on
>sewage is pants...etc..etc )
>
>Marcus W
>
>*I don't expect the Queen to be using it in her address to the Commonwealth
in
>Durban, nor am I aware of the BBC using it in their news reports.

Thanks :)

0 new messages