[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Detect DirectX Version - How?

Posted on 1997-08-13
3
Medium Priority
?
3,741 Views
Last Modified: 2013-12-03
I need to find out whether directX is installed on user's sytem and what version if any. My app requires DirectX2 or later. Virgin Interactive's Subspace program includes a small app called subcheck that does exactly what I'm desiring to do (http://www.subspace.vie.com). It reports directX version number (ie 1/2/3 etc.) and an additional version # (ie. DirectX 3 (version 4.04.00.0068)). I see no docs for doing this in DX3A SDK.

The method of doing CoCreateInstance of IDirectDraw2 to see if DX2 or later installed works but causes a DirectX systemwide failure to occur when my program restarts itself. (When user changes my program's preferences, I sometimes need to restart my program before they can be applied - I restart by executing my commandline (GetCommandLine) and then immediately terminating.) When I do the CoCreatInstance directx check at the start of my program, this restart sometimes causes directx to stop working for my program and all directx programs until system restarted. Therefore I'm interested in alternate methods of determining directX prescence/version.

btw, my current directx check is done like this:

CoInitialize
CoCreateInstance (IDirectDraw2)
if successful, I release object created
CoUninitialize

Thanks,
rob@cyberg8t.com
0
Comment
Question by:RobertM041397
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
davmarc earned 1080 total points
ID: 1404037
The following is an excerpt from KB article Q157730 "How to Determine Installed Version of DirectX":

To determine which version of DirectX is installed on your computer, follow these steps:
1.Using Windows Explorer or My Computer, locate the Ddraw.dll file in the Windows\System folder.

NOTE: If the Ddraw.dll file does not exist in the Windows\System folder, DirectX is probably not installed on your computer. 2.Use the right mouse button to click the Ddraw.dll file, and then click Properties on the menu that appears. 3.Click the Version tab. 4.Compare the version number on the File Version line with the following table:

      Version number   DirectX version
      --------------------------------
      4.02.0095               1
      4.03.00.1096            2
      4.04.00.0068            3

This is for users, but it's still indicative because it says where you should look for DirectX version.
So:
1) If ddraw.dll does not exist on user's Windows\System directory, you can assume that there is not DirectX installed.
2) If it exists, retrieve their version numbers through the APIs GetFileVersionInfo() and GetQueryValue().
3) Map the obtained DLL version number with DirectX version number, and you're done.

Davide Marcato.
0
 

Author Comment

by:RobertM041397
ID: 1404038
One more question: my app runs on both w95 and NT4, is ddraw.dll stored in same spot on NT machine?
0
 
LVL 4

Expert Comment

by:davmarc
ID: 1404039
That KB article was about Windows 95 and I cannot check under NT now - sorry :(

Davide Marcato.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question