I want to use the task dialog in my VC++ application. I am able to create a task dialog successfully using either TaskDialog or TaskDialogIndirect, and it works fine in Vista. However, I want my application to work on windows XP as well, and since windows XP does not support Task Dialog, I have created a dialog of my own that I want to use instead in case the OS is XP.
So my code does something like: if OS is Vista or higher: Show TaskDialog else Show my own dialog
Now the application still does not work in windows XP. When I attempt to start the application on XP, I get the error "The ordinal 345 could not be located in the dynamic link library comctl32.dll". This is possibly because the call to TaskDialogIndirect is there in my code, though the call is in an if block. While loading the application it attempts to locate the function in the comctl32.dll, and it does not find it since it is the XP version of the dll.
So my question is:
How do I code my application so that it runs successfully on both XP and Vista, and in case of XP show my own dialog box whereas in case of Vista and higher show the task dialog?