#8 Inclusion of Windows.h fails

closed
nobody
None
5
2005-12-10
2005-11-01
Thomas Hansen
No

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...

.t

Discussion

  • Logged In: NO

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

    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
    components
    //#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
    user_id=868615

    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
    user_id=868615

    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...