• ### Popular Now

• 13
• 14
• 27
• 9
• 9

#### Archived

This topic is now archived and is closed to further replies.

# DX coding tip (auto list members)

This topic is 5917 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

DirectX has many structures and functions; remembering all of them can be difficult. When writing code in the Visual C++ source editor, you can have the members of a class automatically listed as you access members of a class. I think this feature is pretty cool, and would just like to point out, that in order to have the shortcut work for DX, you need to include the header files to your project. For example, if you want the following code to generate useful shortcuts:
  D3DPRESENT_PARAMETERS d3dpp; d3dp.SwapEffect; 

##### Share on other sites
Including external headers inside the project workspace (those you include using #include <>) is a bad idea because the next machine compiling the code may not install the SDK in the same location.

To work around your problem, check out Visual Assist from (sadly it''s not free)

##### Share on other sites
Wow! I had no idea of that! Thanks for the tip!

##### Share on other sites
Or another way (If I''m reading this thread right) is to define the "include" directory of the sdk\samples\common\include into the compiler header directory path...

then in your projects you simply #include "dxutil.h"....

those compiling your code in the future are then free to install the SDK on their machine wherever they want, then only have to provide the same path in their compiler "header directory path" area....

##### Share on other sites
quote:
Original post by wazoo69
then in your projects you simply #include "dxutil.h"....

The point is that MSVC will not parse files simply "included" in the project (ie external dependencies). So you have to add them for IntelliSense to work.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

Reg''ds,
sTeVe

##### Share on other sites
Oluseyi, there is a trick that seems to work for me. If you #include a header file in your project, then build the project, the newly included file will show up in ''External Dependencies''. If you then drag that file up to ''Header Files'', everything declared in that file will intellisense correctly. I''ve moved the same project between multiple machines with the Platform SDK installed at different locations and it seems to work on both machines.

##### Share on other sites
Why pay for visual assist when MSVC++ does the job for you. Just include the header files as part of your project, then when you send it on to someone else, remove them from the project. I believe the MSVC++ can read environment variables, so another option would be for everyone who works on the same project to define an envronment variable, with an agreed upon name, then point that to the DirectX include path.

---
Make it work.
Make it fast.

##### Share on other sites
quote:
Original post by JonStelly
Oluseyi, there is a trick that seems to work for me. If you #include a header file in your project, then build the project, the newly included file will show up in ''External Dependencies''. If you then drag that file up to ''Header Files'', everything declared in that file will intellisense correctly. I''ve moved the same project between multiple machines with the Platform SDK installed at different locations and it seems to work on both machines.

If you drag a file like that, it will persist as a file in location ./../../theheader.h

Check your properties of the file (Rightclick in workspace view)

If your platform sdk is installed in a different drive or possible different directory structure, then it wouldn''t work.
Yours work probably because your sdk is setup using the same structure.

Besides, Visual Assist has so much more features that makes it worth its price. Don''t believe? Try it.