   Problem running program compiled in Vista on XP
  Hi,Ive seen some similar topics on this, but I havent been able to fix my problem.  Im running a tutorial I found on http://www.directxtutorial.com/.  The program compiles and runs fine on my computer, and other Vista computers as well.  But when I sent the exe to a friend (its just an exe), I found that it wont run on XP machines.  Ive tried statically linking when building, and on the XP machine ive downloaded both the VC++ redist and the Directx runtime stuff for running directx programs.  Although I no longer get the initial configuration error that I was getting before, the program will not run.  It doesnt throw a fatal error, instead it crashes and comes up with a send error report window as soon as the program is started.I tried running it in the dependency walker, and it says that its not finding dwmapi.dll.  When I put dwmapi.dll in the directory, it still wont run, and it looks like it creates more dependency errors in the dependency walker.Any ideas?  All im trying to do is compile the tutorial on that website and get it to run on other computers besides my own.  Ive been all over the internet for over a day now and i havent come up with anything.Thanks,Zack   
  What version of directx are you using?   ;  Sorry bout that.  Its version 9.   ;  Make sure you've configured the windows headers properly so that you only use functionality available in XP.   ;  How would I go about determining if im using some functionality that I shouldnt be?  Im kind've new to this stuff.. sorry if im coming off as stupid, haha.   ;  Ok after a little more digging, I did figure out what's wrong with it.  dwmapi.dll is a vista DLL file and its making a call to the function DwmExtendFrameIntoClientArea(), which doesnt exist on XP.  I think I fully get whats going on now, but I have no idea how to work around it.  Does that mean ill just have to compile the program on XP from now on instead of Vista?  Or can I work around this another way   ;  Here I'll explain a little...the way the Windows SDK works is that you define certain macros that specify the minimum OS version that your app will run on.  When you set that minimum version, things in the windows headers become "available" for you to use.  So for example take something like the the TaskDialog function, which is new for Vista.  If you've set Vista as your minimum version by defining NTDDI_VERSION as NTDDI_VISTA (or by defining _WIN32_WINNT and WINVER as 0x0600), then you can use the function just fine.  If you set XP as your minimum version, you will get a compile error because that function will be "hidden" by the preprocessor.Anyway to make a long story short, if you want to run on XP you should set your macro definitions so that XP is the minimum requirement.  This should cause you to have a compilation error anywhere you're using Vista-only functionality.   ;  Ohhhh, alright that makes sense.  I put#define NTDDI_VERSION NTDDI_WINXPat the top of my code and it threw a redefinition warning (i tried it anyway and it still didnt work) and i looked back and its defined in some wierd header file.. How do I go about defining NTTDI_VERSION correctly?   ;  In MSVC there is a preprocessor option in the C/C++ option tab. Just put the define in there like this:NTDDI_VERSION=NTDDI_WINXPIf there are other defines separate them via semicolon.This makes the define valid for all files not just the one where you put it.Other IDEs should have something similar.   ;  Alright, ive set the preprocessors and the program compilies and runs without throwing any errors at all, but i just tried to run it again on the XP and its still having a dependency on dwmapi.dll and that function that im trying to get rid of...Its probably something really small and stupid with my luck, but I cant figure it out for the life of me.   