Platform SDK: DirectX

Using Macro Definitions

[Visual Basic]

This topic pertains only to applications written in C++. For an introduction to programming for DirectX in Visual Basic, see Visual Basic Programming Topics.

[C++]

Many of the header files for the DirectX interfaces include macro definitions for each method. These macros are included to simplify the use of the methods in your programming, and also have the advantage of expanding to appropriate calls in either C or C++ syntax, depending on whether or not __cplusplus is defined.

The following example uses the IDirectDraw7_CreateSurface macro to call the IDirectDraw7::CreateSurface method. The first parameter is a reference to the DirectDraw object that has been created and invokes the method:

ret = IDirectDraw7_CreateSurface (lpDD, &ddsd, &lpDDS, 
    NULL); 

To obtain a current list of the methods supported by macro definitions, see the appropriate header file for the DirectX component that you want to use.