How do I work with Windows Forms (using C++) and Directx9?

Hi, I need a help!!!

I need a example what show me how to work with windows Forms (using C++) and Directx (9), step-by-step, since declarations until how I create a form and draw inside it a line or other picture, I need a example what make this, if someone can help me.....

Tks.........

[326 byte] By [xxxmpsxxx] at [2007-12-23]
# 1
I can't tell you how to do anything with Direct X, but I can tell you how to implement Direct X features into your Windows Forms Application.

You must have the latest Direct X SDK Installed. In your Windows Forms Project add a reference to Microsoft::DirectX.

In the code you want to use Direct X, add a reference:

using namespace Microsoft::DirectX

You will now be able to use DirectX features in your application.

Best of luck to ya...

DaveS.Anderson at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 2

If you want to work with Native DirectX over the managed one, you need the handle that the form was created with. System.Windows.Forms.Form.Handle is the one you want to look up.

The other option is to use the managed DirectX API as Dave said, but many people try to support existing engines etc which is why its common to see people use the handles as mentioned above to pass along to their native engines. If you don't care about Native engines etc, just go with the Managed DirectX. Be warned Managed DirectX is only for .NET 1.1 (although you can use the API's in Visual Studio 2005) since microsoft are working on replacements I've heard through their XNA framework for a 2.0 solution with DirectX 10.

Maestro at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 3

Tks.....

But I can′t add a reference Microsoft::DirectX, when I go add a reference, I put Microsoft:: and show only CSHARP and Win32, u need show me a handle of sample code, using C++? I have a problem with this.........

Tks..............

Sorry with my english, because I′m brazilian....

xxxmpsxxx at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 4
You'll probably need to install the latest SDK for DirectX, http://msdn.microsoft.com/directx -- grab the SDK from there. It'll let you make DirectX applications. Also make sure you are using Visual C++ 2003 and above to make it work. And make sure you setup a winforms application.
Maestro at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 5

Maestro wrote:
You'll probably need to install the latest SDK for DirectX, http://msdn.microsoft.com/directx -- grab the SDK from there. It'll let you make DirectX applications. Also make sure you are using Visual C++ 2003 and above to make it work. And make sure you setup a winforms application.

But I have installed the Directx 9 SDK, and I′m using Visual Studio.Net 2003, in options (on Visual Studio), I include the library and include of DirectX, but the error continue...

What I do? Why don′t show the option Directx when I reference Microsoft:: ?

Tks

xxxmpsxxx at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 6

Ok,

DirectX 9 has two components, it has the native components, where you include the library and you #include the headers, and the managed which simplifies DirectX on managed applications using WinForms.

If you want to access the managed one, and get the Microsoft::DirectX namespace you need to add inside your project a reference to it. The way you do this is you Right click on references and you search for Microsoft.DirectX. You need to have installed the Managed DirectX extension which comes with the later versions of the DirectX 9 SDK. You do not include the Lib and #include like the traditional Native DirectX. I suggest if you still have problems you consult the Managed DirectX documentation, they have step by step tutorials on how to get something on the screen, and also there are numerous tutorials on the web.

Maestro at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 7
You might also like to look at this website http://pluralsight.com/wiki/default.aspx/Craig.DirectX.Direct3DTutorialIndex it has many managed Direct3D tutorials and its been translated into numerous languages that may make it easier for you to understand
Maestro at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...