DirectX 8, Direct3D, Combining the Common Files with MFC CView?  
Author Message
JonAkaJon





PostPosted: Game Technologies: DirectX 101, DirectX 8, Direct3D, Combining the Common Files with MFC CView? Top

Compiler: Visual Studio.NET 2002

Hi Everyone,

I am learning DirectX 8. (I want to use DirectX 8 as this comes as standard in Windows XP install. If I write a program I know my ludite-XP-using-friends will be able to use it without having to download a new version of DirectX.)

I am writing a program that uses DirectX 8 and am trying to combine the Common Files into a MFC application that is based on the CView class rather than the CFormView used in the MFCFog example. The program I will write will be single document (as opposed to multi-document).

In the Fog example a derived class is created, of the type:

class CMyMFCAppForm : public CFormView, public CD3DApplication
{
};

I am trying to set up a class of the form:

class CMyMFCAppForm : public CView, public CD3DApplication
{
};

I am having real trouble doing this, as I am getting really confused about how I am meant to set the program up with Initialisers etc. Ideally I would like to use the Visual Studio.NET 2002 'New Project Wizards' to set up the MFC bit and then plug the common DirectX 8 files like d3dapp.h into it.

At the moment I am getting a 'Debug Assertion Failed'. It occurs at line:

ASSERT(AfxGetThread() == this);

in the function:

CWinApp::CWinApp(LPCTSTR lpszAppName)


in the microsoft file 'appcore.cpp'

I am semi-new at programming. I find the DirectX stuff easier than the 'setting a program up' stuff. So this might even be an error related to my resources or something trivial.

I have a zipped file of my code if anyone is interested I can email it to them. If I include the *.ncb file it is a quarter of a Meg. If I do not include the *.ncb file it is very small.

Yours with hope,

Jon



Game Technologies: DirectX, XNA, XACT, etc.15  
 
 
David Weller





PostPosted: Game Technologies: DirectX 101, DirectX 8, Direct3D, Combining the Common Files with MFC CView? Top

Compiler: Visual Studio.NET 2002

I am learning DirectX 8. (I want to use DirectX 8 as this comes as standard in Windows XP install. If I write a program I know my ludite-XP-using-friends will be able to use it without having to download a new version of DirectX.)

A couple of points to make:

1) Your Visual Studio is horribly outdated. Get Visual C++ express edition. It's free, and you get a very powerful tool. Read more here :-)

2) Windows XPSP2 has DirectX 9.0c runtime by default. There's absolutely no reason to use DirectX 8.



 
 
JonAkaJon





PostPosted: Game Technologies: DirectX 101, DirectX 8, Direct3D, Combining the Common Files with MFC CView? Top

Compiler: Visual Studio.NET 2002

Hi David,

Thanks for your mail.

The people I am aiming the program at got Windows XP when it first came out. The most they do with their computers is a bit of email. I have tried to encourage them to download the things like SP2 but they do not like the idea (strange but true - they are true ludites). That is why I am using DirectX 8, as it is installed with the original version of XP.

As for VS 2002, I also have VS 2003. I want to stick to my purchased versions of Visual Studio as this gives me distribution options. I still have not upgraded to 2003 as I am really used to 2002. (Also when I first got 2003, it complained I was using an old DLL. As it is one I use a lot so I chose to stick to 2002 for a while.)

So if anyone has any ideas on my CView question I am still eager to find out.

Yours with hope,

Jon