Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

Windows 2000 Graphics API Black Book
Home | Introduction | Table of Contents | Updates | New Stuff | Links | About the Authors | Ordering
 

Problems with DirectDraw Samples on Windows 2000 with DirectX 8.1

There is a problem with the DirectDraw samples running on Windows 2000 with DirectX 8.1. Dynamically loading ddraw.dll, as the SafeDirectDrawCreateEx function in ddhelper.cpp does it, does not work. All samples using this function, namely all those that are built on the ISFrame framework, will crash on startup. There are two ways to correct this problem:

  • Open the file isframe.cpp, which can be found in the isframe sub-folder of the DirectDraw samples folder, and change line 422 as follows:

    //   hr = SafeDirectDrawCreateEx(     // SafeDirectDrawCreateEx is declared in
    //                                    // ddhelper.h
       hr = DirectDrawCreateEx(
    

    You can download the corrected file from here.

    Note: DirectDrawCreateEx is imported from ddraw.dll through ddraw.lib. You need to link the applications to this file, which can be found in the lib sub-folder of the DirectX SDK, by adding ddraw.lib to the list of library/object modules on the Link tab of the Project Settings dialog.

  • You can also download a ZIP file, Win2k_dx81_update.zip (75 kB), containing the file isframe.cpp plus updated project files for Visual C++ and Borland C++Builder. (To build the executables, use the samples.dsw/samples.bpg project groups in the DirectDraw samples root.) The rest of this document explains how to apply the update.

Applying the update file

To apply the Win2k_dx81_update.zip file, you perform the following steps:

  1. Download the Win2k_dx81_update.zip (75 kB) update file.
  2. Copy the DirectDraw samples folder from the companion CD-ROM to your hard drive.
  3. Remove the read-only attribute from all of the files in the DirectDraw samples folder. The easiest way to do this is to use the Find dialog as depicted in the following figure:

  4. Open the Win2k_dx81_update.zip update file and extract its contents to the DirectDraw samples folder on your hard drive. You should be presented with a series of dialogs that prompt you for confirmation for replacing the files. Simply click "Yes to All" and you should be good to go. Sorry for the trouble.

 

Copyright © 2001 Damon Chandler and Michael Fötsch