DirectX in MFC MDI app

DirectX in MFC MDI app

Post by Rich Curti » Tue, 28 May 2002 01:45:24


Thanks to MS for DX and these forums.

I'm new to both MFC and DX, but I'm trying to do a
tutorial where you create an MFC app in the AppWizard, and
then use DX to render your child windows.

I keep getting the same error with SetTransform. It
basically is telling me that it can't take the address of
my D3DXMATRIX as an address (&mymatrix). I think I have a
configuration problem with my project, but I can't figure
it out.

SetTransform takes a const D3DXMATRIX pointer, but would
that matter if I passed it my matrix as a reference? I'm
doing it exactly as shown in the docs, but it still won't

I can post the source if people want to see it.

Thanks in advance for any help you can give.

The tutorial is Frank D Luna's on gamedev, btw. It's at
if people want to check it out. (hope that was ok to post
the URL).

Thanks again!



DirectX in MFC MDI app

Post by Rich [Microsoft Direct3D MV » Tue, 28 May 2002 02:13:13

[Please do not mail me a copy of your followup]

Quote:>I keep getting the same error with SetTransform.

You mean a compilation error?  Post the call to SetTransform,
including the declaration of any variables used as arguments, and also
post the compile error you're getting.  Its probably something simple.

Quote:>SetTransform takes a const D3DXMATRIX pointer,

It takes a pointer to a const D3DMATRIX -- since D3DXMATRIX derives
from D3DMATRIX, they have an "is a" relationship.  (A D3DXMATRIX "is

Quote:>but would
>that matter if I passed it my matrix as a reference?

If the matrix is passed by reference into your function, you still
have to take its address when calling SetTransform.
Ask me about my upcoming book on Direct3D from Addison-Wesley!
  Direct3D Book
    izfree: Open source tools for Windows Installer


1. MDI MFC DirectX

First of all sorry for mi poor english. Currently i
working on a project using a MDI interface based on the
MFC archiecture. The graphic 3D sub-system is outside the
main program in a separate MFC extension DLL and,
following user choices, currently can be Windows GDI (low
level rendering) or OpenGL (high level rendering). I
looking for a MDI MFC project that using DirectX API
interface for output but only simple dialog or SDI
application i found on the NET. Anyone know a sampe or
some information about this topic.
Thanks in advance.

2. Texture Map of the Week - Elephant Skin

3. opengl crash on nt2000 VC 6.0 MFC MDI app using spliiterWnds

4. ATM

5. mdlviewer source released (MFC MDI OpenGL app)

6. Newbie Question

7. Need help: OpenGL in MFC MDI Application

8. Textureproblem (MFC/MDI)

9. OpenGL & multithreaded MFC/MDI

10. MFC: MDI 4 wndws with OpenGL HOWTO

11. MFC MDI OpenGL Question

12. MFC-MDI OpenGL example wanted...