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

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

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

JonAkaJon
JonAkaJon wrote:

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.




David Weller [MSFT], Community Manager, Microsoft Game Development Group. http://letskilldave.com
David Weller

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

JonAkaJon
reply 3

You can use google to search for other answers

 

More Articles

• Direct3D Initialization
• Games with sound impossible in MDX 2.0
• Video Tutorials
• DirectX AppWizard for Visual Studio 2005
• using Microsoft.Samples.DirectX.UtilityToolkit
• DirectX vs. WPF
• Problem with ComputeBoundingSphere
• Direct3D View Matrix: porting problem from OpenGL
• What do I need to draw CustomVertex.PositionColored?
• finding the vertex locations in a loaded mesh
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• October 2005 DirectX SDK is available!
• Unmanaged directX and .net windows form
• DX9c and VStudio 6
• I have some artifacts with fog
• How to use bitmaps
• DirectX version needed to run an applica
• LoaderLock was Detected?
• [MDX][C#] SwapChain pain in the rear end
• Latest DirectX SDK Update for Windows 20
• Cannot Open Prcomplied Header
• Mesh optimization
• Streaming directly from mic to speakers
• basic rendering problem with scene mesh
• DirectSound Error Codes
• Possible to make an online RPG with Dire

Hot Articles

• Coordinate System
• Mesh size versus scaling
• Pixel Shading & Vertex Shading
• Simplest method for drawing rectangles
• Lighting and Rendering
• Record from microphone and play
• How make a DirectX application runs on W
• Aug2006 SDK install question
• Disabling and Enabling USB joystick
• DirectX 10 shader compiler?
• SampleFramework Camera
• Why does my window go blank after a resi
• Where to go?
• DirectDraw multi-threaded blitting
• DirectPlay

Recommend Articles

• Some questions about directx transform
• Beginner going Mad!!
• 4 Beginners!
• Which language should I use?
• where is system.dll??
• Preventing window resizing in fullscreen
• Simple example for February 2006?
• I cant download directx sdk!!!!
• Double Buffering, Managed DirectX
• C# Exception Assigning an Index Buffer
• Where did event Device.DeviceResizing go
• Mouse / Keyboard Events when using Simpl
• Problem with "PlaySound()" Fun
• ps3.0 queries
• Getting Started Is Hard