locked
afxwin.h missing? windows.h missing? What am *I* missing?

    Question

  • I downloaded and installed Visual C++ EE yesterday. I'm trying to compile some OCX example code that came with a vendor library, and it's failing because "afxwin.h" can't be included. I did a search and neither than file nor "windows.h" exist on my machine.

    What am I missing? It's been a while since I've tried to write C++ on Windows machines, but aren't these headers fundamental? Why aren't they installed with VC++? How can I get them and the other basic stuff needed to do development here? What am I missing?

    Wednesday, June 07, 2006 8:22 PM

Answers

  • Sorry, that was slang.  "No-go" means: you'll never get that for free with any Express edition.  Microsoft will support MFC for many more years.  If you think you can just barely afford the Professional edition right now, run to the store and cough up the money.  You'll be set for the next two years, if not longer...

    Wednesday, June 07, 2006 9:30 PM
  • MFC is definitely not deprecated or going away - we are currently actively working on the next release. The whole point of the Express Edition was to help people learn C++ - I for one feel people should learn C++ before they learn MFC (you'd be surprised by the number of people who try to learn the other way around). It was also meant for downloading so even in these days of broadband we had to limit the size - hence the separate PSDK download and the exclusion of MFC. If you are doing "professional" development then the Express Edition is really not the best product - you should get either the Standard Edition or one of the Visual Studio editions.
    Thursday, June 08, 2006 4:03 PM

All replies

  • You're missing MFC to get afxwin.h and the Platform SDK for <windows.h>.  They don't come included with the Express edition.  MFC is a no-go but you can get the Platform SDK; search this forum for "SDK".

    Wednesday, June 07, 2006 8:42 PM
  • Thanks, that helped a lot.  What does "no-go" mean, though?  Do you mean that Microsoft now charges for MFC, or that they don't support it at all?  I searched around some, but couldn't find anything.   I wish they'd document this stuff.
    Wednesday, June 07, 2006 9:15 PM
  • Sorry, that was slang.  "No-go" means: you'll never get that for free with any Express edition.  Microsoft will support MFC for many more years.  If you think you can just barely afford the Professional edition right now, run to the store and cough up the money.  You'll be set for the next two years, if not longer...

    Wednesday, June 07, 2006 9:30 PM
  • Thanks for your help.  I may have to do that--it'd be my employers money anyway, and probably better for them in the long run.  I don't mind the $$ so much, but it'd be nice if they'd be explicit about what EE does and doesn't do.

    Which version should I get?  Given my bad luck so far with Visual C++ 2005 Express Edition, should I try for an older version?

    I almost got my program working with the PSDK, but I'm having a missing library problem, which I'll put in a separate thread.


    Wednesday, June 07, 2006 10:44 PM
  • What do you mean bad-luck? What is included in Visual C++ EE is well documented. For example

    http://msdn2.microsoft.com/en-us/library/hs24szh9.aspx

    If you are just doing C++ programming then I would get Visual C++ Standard Edition - if you need support for other languages then I would get Visual Studio Professional Edition

    Wednesday, June 07, 2006 11:46 PM
  • That's a helpful link--thanks.  I downloaded VC++ EE from here

        http://msdn.microsoft.com/vstudio/express/visualc/download/

    and the feature page linked (four times) from there doesn't give this kind of information.  (There is a link to the PSDK download page, though I didn't understand the significance of that until later.)

    By "bad luck" I meant specifically that I'm having a great deal of trouble trying to compile vendor example code for their OCX and I'm wondering whether part of the problem is that since this code is several years old, some of the features have since been deprecated in the latest VC++ (and therefore maybe I should try to find an older version).  (The corresponding VB example code doesn't compile in the current version of VB either, which also adds to this feeling.)

    Apparently MFC is somewhat deprecated, at least in the sense that it wasn't chosen for inclusion in EE, which I'd take as a sign that MS doesn't want newbies to use it anymore.  Distributing the PSDK separately is actually a good move, I think, but initially frustrating for prior users of VC++ used to having it bundled along.  Finally, in trying to work with this vendor OCX, I was able to add it to the "Toolbar", but it's grayed out there, for no apparent reason and with no explanation given, leading me to feel that this version of VC++ is somehow incompatible with it.

    Some of this can be chalked up to the learning curve, but it seems awfully steep.
    Thursday, June 08, 2006 3:46 PM
  • MFC is definitely not deprecated or going away - we are currently actively working on the next release. The whole point of the Express Edition was to help people learn C++ - I for one feel people should learn C++ before they learn MFC (you'd be surprised by the number of people who try to learn the other way around). It was also meant for downloading so even in these days of broadband we had to limit the size - hence the separate PSDK download and the exclusion of MFC. If you are doing "professional" development then the Express Edition is really not the best product - you should get either the Standard Edition or one of the Visual Studio editions.
    Thursday, June 08, 2006 4:03 PM
  • The SDK for Visual C++ EE is available for free download at

    http://www.microsoft.com/downloads/details.aspx?FamilyID=484269E2-3B89-47E3-8EB7-1F2BE6D7123A&displaylang=en&Hash=8XQxtADLl8bKnNDG4HxHXgHk1xyMug9zwtShZJACrt2SrwpMEHVXpAGmi8MrB%2b2Xi4t9wH3oAuaYKj1QvnXp%2fQ%3d%3d#filelist

    I'm in the process of downloading it right now. It comes in the form of about 18 files, 25 mb each. What a hassle.... but it's free!!

     

    Zorweb

     

    Thursday, February 01, 2007 9:10 PM
  • That is the platform SDK, is not just for the express edition (it's primarilly an update for older and competing compilers).

    It indeed includes MFC, but most people prefer to not write user interfaces in MFC by hand and it doesn't include the designer

    Saturday, February 03, 2007 6:33 AM
  • A quick word about the MFC version that is included with the Platform SDK: it is only suitable for 64-bit builds, don't try to use it for 32-bit builds.  I think Express only includes the 32-bit compiler so it's a "no-go".  There have been a few attempts at porting the 64-bit version to 32-bit but they were abandoned.  Porting the 64-bit version of ATL has however been successful.  All and all, by the time you're done messing with this, you'd have earned yourself an RTM version.
    Saturday, February 03, 2007 9:42 PM
  • I too have this problem with VS2008, Its quite bad as when you start a new project (command line app) the compiler complains that it cannont find afxwin.h, vs2008 good program, but bad idea for distributing it with out this essential feature.

     

    "afxwin.h missing?  windows.h missing?  What am *I* missing?" should have read, "afxwin.h missing?  windows.h missing? what hasent microsoft GIVEN us!"

     

    Its like buying a car, but you have to supply the engine!

    Saturday, April 19, 2008 1:00 AM

  • I agree with the frustration.

    If you try to do Test Driven Development with CppUnit you will notice you can't compile testrunner with Visual C++ Express Edition 2008 because of the missing afxwin.h problem. In other words, even if you install VC++ EE and the latest Windows SDK, you still can't code according to best modern coding practices (TDD) with the Microsoft free offer. That is a shame.


    marcio
    Wednesday, September 03, 2008 2:21 PM
  • Some stuff does work, I mainly user VS2008 for Orbiter and DarkGDK from the game creaters, it works in that respect but with other software projects if it has afxwin.h as an include file i don't even try!

    Mind you im think of developing in linux, even if there is no money in it!


     sglebs wrote:

    I agree with the frustration.

    If you try to do Test Driven Development with CppUnit you will notice you can't compile testrunner with Visual C++ Express Edition 2008 because of the missing afxwin.h problem. In other words, even if you install VC++ EE and the latest Windows SDK, you still can't code according to best modern coding practices (TDD) with the Microsoft free offer. That is a shame.


    marcio
    Friday, September 05, 2008 8:28 AM
  • Odd that you would consider developing for Windows because there might be more money in it than Linux, but won't consider paying for your tools.  It takes some to make some.
    Friday, September 05, 2008 5:39 PM
  • Sooo, I'm good and lost.  Smile

     

    I have some older code, just like the thread originator.  I'm not a coder, I'm just trying to compile someone else's code for a little command line INI tool I need in a script.  (found here :http://www.codeproject.com/KB/applications/iniutils.aspx)

     

    I've downloaded Visual C++ 2008 Express Edition and the XP Platform SDK, but I think the SDK was an unnecessary step - my only error is:

    c:\downloads\software\mergeinifiles\stdafx.h(15) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

     

    So I see messages about AFX included in the SDK, not in the SDK, 64 bit only in the SDK, ports and platform culture forehead bumps.  I think the answer is in here, but I'm not sure.  I think I see that a licensed version of the development environment will give me a cool tool that I'll never use, and I think (maybe) I can be assured of an afxwin.h file.

     

    Is this what I have to do?  The end script will grab a social calender off a web-page, dump entries to an ini file and send me an e-mail - no business purpose, so I'm trying not to spend money.  If I don't need the value add of the dev tools, is there any way to compile this with publicly available resources?

     

    Thanks, y'all.

    Wednesday, December 10, 2008 9:45 PM
  • I wonder if there is an a way to create the winafx.h and windows.h file's, I know some FREE compilers have these, but to use them in VS2008 i guess you would need the source code and compile the libarys IN VS2008, maybe that would be the way to beat the system.

    Its been a while since I used VS, ive been concerntrating on uni, now that I have time I may come back to it for a bit.
    mmuzzzaaaa
    Friday, December 12, 2008 11:37 PM
  • I found in other site the source code, 

    I think experts in this one are not very polite

    
    
    /************************************************************************
      T h e   O p e n   F o u n d a t i o n    C l a s s e s
     ------------------------------------------------------------------------
      Filename   : afxwin.h
      Version    : 0.60
      Author(s)  : William D. Herndon
     --[ Description ]-------------------------------------------------------
    
      This file is part of the OFC - Open Foundation Classes -.
      It is MFC compatible.
      This is the main include file for projects using OFC: all it really
      does is include the other exported include files. It has the same name
      as the main include file for MFC, so projects will not need to change.
    
      --[ History ] ----------------------------------------------------------
    
    cb  = Carsten Breuer     (Carsten.Breuer@breuer-software.de)
    gv  = Geurt Vos          (geurt@users.sourceforge.net)
    id  = Ivan Deras         (ideras@users.sourceforge.net)
    tm  = Tim Musschoot      (timussch@users.sourceforge.net)
    wdh = William D. Herndon (shadowdog@users.sourceforge.net)
    
    mm-dd-yy  ver   who  what
    10-05-03  0.10  wdh  Created.
    10-12-03  0.20  wdh  Changed from windef.h to windows.h to be MS compatible.
    11-02-03  0.30  wdh  Added CGdiObject*.h includes.
    11-09-03  0.40  wdh  Added ofcglobals.h and CObjFromHandle.h
    11-25-03  0.50  wdh  Added CCmdUI and CCmdTarget.
    05-30-04  0.60  wdh  Added CArchive, CWnd, CDocument, CDocTemplate, CView,
        CFrameWnd, CWinApp and the CCommandLineInfo hack and CCreateContext.
    
     --[ How to compile ]----------------------------------------------------
    
      This file was developed under DevC++ 4
    
      --[ License ] ----------------------------------------------------------
    
      This program is free software; you can redistribute it and/or
      modify it under the terms of the GNU General Public License
      as published by the Free Software Foundation; either version 2
      of the License, or (at your option) any later version.
    
      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.
    
      You should have received a copy of the GNU General Public License
      along with this program; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    
     ------------------------------------------------------------------------
      Copyright (c) 2000-04 Open Foundation Classes
      Copyright (c) 2003-04 William D. Herndon
    /************************************************************************/
    #ifndef __AFXWIN_H__
    #define __AFXWIN_H__
    
    #include <string.h>
    #include <windows.h> // Standard Windows includes from CygWin or MS
    
    #include <ofcglobals.h>
    #include <CPoint.h>
    #include <CSize.h>
    #include <CRect.h>
    #include <CString.h>
    #include <CString_inline.h>
    #include <CObject.h>
    #include <CException.h>
    #include <CFile.h>
    #include <CArchive.h>
    #include <CArchive_inline.h>
    #include <CObjFromHandle.h>
    #include <CGdiObject.h>
    #include <CGdiObject_inline.h>
    #include <CCmdUI.h>
    #include <CCmdTarget.h>
    #include <CCmdTarget_inline.h>
    #include <CWnd.h>
    #include <CWnd_inline.h>
    #include <CDocument.h>
    #include <CDocument_inline.h>
    #include <CDocTemplate.h>
    #include <CDocTemplate_inline.h>
    #include <CView.h>
    #include <CView_inline.h>
    #include <CFrameWnd.h>
    #include <CFrameWnd_inline.h>
    
    #if 1 // Quick hack
    class CCommandLineInfo {
    public:
        int m_iGarbage;
    };
    
    class CCreateContext {
    public:
    	CCreateContext(CRuntimeClass* pViewClass,CDocument* pDoc,
    		CDocTemplate* pNewDocTemplate)
    	{
    		m_pNewViewClass   = pViewClass;
    		m_pCurrentDoc     = pDoc;
    		m_pNewDocTemplate = pNewDocTemplate;
    	};
    
    	CRuntimeClass* m_pNewViewClass;
    	CDocument*     m_pCurrentDoc;
    	CDocTemplate*  m_pNewDocTemplate;
    };
    
    #endif
    
    #include <CWinApp.h>
    #include <CWinApp_inline.h>
    
    #endif // __AFXWIN_H__

    Sunday, March 18, 2012 3:55 PM
  • I too have dnloaded many windows programming packages, even bought a few and NOT one of these have ever ran all the samples without massive errors and all MS seems to want do is have you buy more software or call support ( that is mostly useless ). Even had a ms support package that when you tried to use the thing THEY TOO wanted you to upgrade to some other useless program. Gosh guys. You know you will have to answer to someone some day. And he will not let you lie or rationalize your way out of anything. So how about actually trying to help your customers instead of bleeding us.
    Sunday, April 15, 2012 1:15 AM