• ### Popular Now

• 12
• 9
• 9
• 13
• 10

#### Archived

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

# So close yet so far....

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

## Recommended Posts

Hi Just got into dx programming. Using borland dx sdk 8.0 and compiling with BC++ builder 4.0 pro. Using lib files provided by Michael Fötsch. Want to try and compile and run SDK example for SwitchScreenMode. Everything compiles ok - don''t even get warnings. (Took me AGES to get this far :-/) Sadly, when it runs I get "InitDirectDraw fails". I tracked the problem down to this function: g_pDisplay->CreatePaletteFromBitmap( &pDDPal, MAKEINTRESOURCE( IDB_DIRECTX ) ) ) I think i know why its not running but i dont know what to do about it. Basically, IDB_DIRECTX refers to the directx.bmp graphic which is stored in a resource file: SwitchScreenMode.rc. I''ve added this file to my project. *NOW*, its looking for a header file: afxres.h This file is not in the dx sdk, in the common headers or shipped with borland c++ builder. What action should I take? NOTE: switching to VC++ is NOT a solution for me. Thanks for all help in advance.

afxres.h is created by the Visual C++ resource tools and contains, among other things, defines for resource IDs - like IDB_DIRECTX. The afxres.h file should be included with the other source code for the SwitchScreenMode sample.