Archived

This topic is now archived and is closed to further replies.

MethodicalJ

Please help :(

Recommended Posts

I'm working on a user interface with directx in c++, but I can't include "afx.h" or "afxtempl.h" or anything, since it gives the error that MFC apps must not include "WINDOWS.H". I need to use CArrays and CStrings. Can anyone help me? I started the app with the DirectX appwizard, if that helps. [edited by - methodicalj on May 19, 2004 9:02:35 PM]

Share this post


Link to post
Share on other sites
Not exactly sure what your problem is. But in an MFC app, you need not include windows.h. S oremove that if you are doing that.

Secondly, you only need to inlcude StdAfx.h as the FIRST include file in every .cpp file of your project. (This is because MFC uses pre-compiled headers, and for those to work, this must be the FIRST include file in all .cpp files of the project).

Note, the emphasis is on it being the FIRST include file.

Hope that helps!

Share this post


Link to post
Share on other sites
let me rephrase

i cannot seem to find any way (incuding the way just sugested) to get a CArray to work in a directx app.

I used the directx appwizard to create a directx app, with only 2d code, and i need to use carrays. other than that it''s almost exactly as the wizard made it. (kind of hard to get to far in a project when you can''t get data structures to work right)

if anyone can say exactly how to make this work, please respond.

Share this post


Link to post
Share on other sites
The best thing to do would be to rewrite your app to not use CArrays. The STL provides alternatives. Besides, it''s an array class; how hard do you think it would be to code yourself?

You might be able to copy the CArray code out of the MFC source, but it''s really not a good approach.

Share this post


Link to post
Share on other sites