Using Managed DirectX9 with VC++.NET

Morpheus_3074

Newcomer
Joined
Mar 10, 2003
Messages
2
Greetings fellow C++.NET junkies!!!


I am Morpheus and I have been searching for you all my life......

It is the question that drives you .....
#using <FreeYourMind>


How do I get Managed DirectX9 to work with VC++.NET Standard?


.......................................................................................................
Wise man once said "Simplicity will be the most difficult thing to master." -- ME (2003)
.............................................................................


##--- After Installing DirectX9 SDK ---##

Managed DirectX Framework Default Installation Location: %system%\Microsot.NET\Managed DirectX\v4.09.00.0900\

Goto Tools -> Options
Expand the Projects folder
Select VC++ Directories

Under "Show Directories For"
Select Reference Files

Create a newline and add the path to the Managed DirectX dll's.
..............................

That's All Folks!!

Don't try to bend the spoon....It is impossible!!! Rather it is your mind that bends..


..............................

Now calls to #using <microsoft.directx.dll> and other Managed DirectX dll's are valid and their respective namespace usages are 100% functional.

PLEASE BE ADVISED!!
VC++ will not provide you with class info when using scope operator :: . Just refer to Managed DirectX documentation for class info and namespace information.

Example:

The following code is only intended to test directx namespace usage by fully compliling and linking.
C#:
//usage.h

#using <mscorlib.dll>
#using <microsoft.dirextx.direct3D.dll>

using namespace microsoft::directx::direct3d;

namespace TestUsage
{
     public __gc class Usage
     {
     protected:
          PresentParameter __nogc* PParams;

     public:
          Usage()
          {
                PParams = new PresentParams;
           };

           ~Usage(){};
     };
}
C#:
//Source file usage.cpp

#include "usage.h"

int main()
{
     TestUsage* UTest = new TestUsage;
     return 0;
}
Hope this was helpful. If you still have problems...post a message and we will enter the Matrix so I can show you!!!

Continue the Journey and Remember to....
Follow the White Wabbit.

hehe

[edit]No need to make Size=1 for the entire post, simply use
C#:
 tags [/ cs] arround your code.[/edit][/COLOR]
 
Last edited:
Doh, mine didn't pass the test

I get this error. Is there something obvious I have overlooked?

c:\DirectX9Application1\usage.cpp(3): fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option
 
Back
Top