#8 Inclusion of Windows.h fails


If you include Windows.h befre including SmartWin++ you
get lots of weird bugs due to double definitions...

If this is possible to fix we should do so...



  • Nobody/Anonymous

    Logged In: NO

    In addition to Windows.h, I hope you support this common

    Some of my projects use afx.h, afxwin.h, and afxdisp.h
    instead of windows.h. Doing this DOES NOT cause my
    project to link to MFC, but it does cause the inclusion of OLE
    (which I sometimes require).

    When including these headers, windows.h cannot be used in
    the project.

    This is what I have in my stdafx.h for projects that require OLE
    but not MFC. Note that most includes are commented out but
    shown here for completeness:

    #define VC_EXTRALEAN // Exclude rarely-used
    stuff from Windows headers

    #include <afx.h>
    #include <afxwin.h> // MFC core and standard
    //#include <afxext.h> // MFC extensions
    //#include <afxdtctl.h> // MFC support for Internet
    Explorer 4 Common Controls
    //#ifndef _AFX_NO_AFXCMN_SUPPORT
    //#include <afxcmn.h> // MFC support for
    Windows Common Controls
    //#endif // _AFX_NO_AFXCMN_SUPPORT

    #include <afxdisp.h>

  • Thomas Hansen

    Thomas Hansen - 2005-11-06

    Logged In: YES

    I am not realy sure if inclusion of afx.h etc will work, but
    this is something we should look into yes!

  • Thomas Hansen

    Thomas Hansen - 2005-12-10
    • status: open --> closed
  • Thomas Hansen

    Thomas Hansen - 2005-12-10

    Logged In: YES

    I tried this but it appears t work, at least in the
    WidgetChildWindow sample....
    Regarding the afx.h it gives me linking errors so this is a
    bigger job...


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks