Solved

Detect DirectX Version - How?

Posted on 1997-08-13
3
3,726 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 270 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Alternative to visual sourcesafe 2 153
Build VS2015 project in bat command 3 106
SSRS Deployment problem 5 125
RestClient.cs fails at (HttpWebResponse)request.GetResponse()) 4 51
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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