CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: DirectX 3D

  1. #1
    Join Date
    May 1999
    Location
    UK (South)
    Posts
    93

    DirectX 3D

    When I use MFC appwizard to generate boiler plate app and then #include "d3drmwin.h" I get an error suggesting that I have tried to include windows.h twice.

    Anybody got any clues?

    Research Engineer
    Goodmans Loudspeaker Ltd
    Havant, UK.
    [email protected]

  2. #2
    Join Date
    May 1999
    Location
    Oregon, USA
    Posts
    302

    Re: DirectX 3D

    This shouldn't be a problem since windows.h has this at the top of it :

    #ifndef _WINDOWS_
    #define _WINDOWS_

    I went through those headers and it's really a mess.
    Lot's of nested includes but I guess that can be difficult to avoid.
    Personally, I try to do the protection outside the header, not in it.

    Anyway, could you be more specific about the error condition you are getting ?



  3. #3
    Join Date
    May 1999
    Location
    UK (South)
    Posts
    93

    Re: DirectX 3D

    I have added two lines of code in the StdAfx.h file.

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

    #define INITGUID // these lines added

    #include "d3drmwin.h" // these lines added.

    #include <afxwin.h> // MFC core and standard components




    And got the error.


    c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) :
    fatal error C1189: #error :
    WINDOWS.H already included.
    MFC apps must not #include <windows.h>


    I hope this helps clear up the problem.


    Thanks
    Simon Pettman



    Research Engineer
    Goodmans Loudspeaker Ltd
    Havant, UK.
    [email protected]

  4. #4
    Join Date
    May 1999
    Location
    Oregon, USA
    Posts
    302

    Re: DirectX 3D

    Try placing the d3drmwin.h include after afxwin.h
    Also, the is a Direct-X library for use with MFC at
    http://www.dxfc.com that might be helpful.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured