Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I am trying to something in DX9 in Managed C++, but I have just one tiny question, here it is: What do you put in the #using <Whatever.dll>? I've tried #using <Microsoft.DirectX.dll> and that didn't work, so what does it?
Posted

Ok, I just got that bit, but another problem has risen:

Now that I have included (?) the DirectX dll, how do I actually use any of it's functions? When I put: using namespace Microsoft, DirectX isn't there. How do I deal with this one?

Posted

The basic declaration for DX is: (that what worked for me)

 

#include <d3dx9.h>

 

Thats basically it for all the basic DX operations. For more advanced things i think you need to copy some headers from the sdk to your folder.

Posted

I think including the header files only exposes the UNMANAGED com interfaces/functions.

 

to use the managed assemblies, afaik you just include them in the project, and code away.

  • 4 weeks later...
Posted (edited)

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.

//usage.h

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

using namespace microsoft::directx::direct3d;

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

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

          ~Usage(){};
    };
}


//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

 tags [/ cs] arround your code.[/edit][/color]
Edited by Morpheus_3074
  • 2 months later...
Posted

A couple of things...

 

Ok, Thanks and kudos to Morpheous for making simple what Microsoft apaprently has to royally up.

 

Or maybe it's just my understanding of the IDE.. but I thought under projects, the #using directory would have done the trick, referecing the global assembly directory.

 

So, I am using Visual C++ .NET 2003 standard, and I am pleasently surprised that it did automatically pick up on the namespaces shortly after doing what morpheous suggested.

 

So hence my question now: what's the difference then between the assemblies in the global assembly cache, which have the whole direct3d managed enchilada and the .dll's?

 

Are the .dll's just "hooks" into the assemblies from Managed C++? Morpheus, can you shed light on the issue! thanks!

 

- Raist

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...