evo_x
asked on
how to get the installed Directx version?
How can I get the installed DirectX version?
I use C++ and DX11
in the older versions of directx there was a utility sample which had a getdxversion function, but in DirectX 11 I can't find it anymore.
I use C++ and DX11
in the older versions of directx there was a utility sample which had a getdxversion function, but in DirectX 11 I can't find it anymore.
http://msdn.microsoft.com/en-us/library/bb757015.aspx
ASKER
I need to display the installed DirectX version for a system information utility.
Microsoft DLLs usually have a version information resource. The DirectX DLL's do, you can see it if you open the DLL as resources. If you have the path to the DLLs you can use GetFileVersionInfo and VerQueryValue to read version information for display (this is what Dxdiag.exe does).
The concept of a version of DirectX is a bit wrong though. There are many parts to DirectX and they can be at different versions. Also the DLL version is not the same as the version DirectX is said to be at. The DLL's on my PC are version 5.3 though I have DirectX 9 installed.
In theory there is no guarantee the version information will always be there. Though I can't see MS removing it anytime soon.
The concept of a version of DirectX is a bit wrong though. There are many parts to DirectX and they can be at different versions. Also the DLL version is not the same as the version DirectX is said to be at. The DLL's on my PC are version 5.3 though I have DirectX 9 installed.
In theory there is no guarantee the version information will always be there. Though I can't see MS removing it anytime soon.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the getdxversion class was perfect since directx9, now how can I combine 3 methods ? to get an acurate result ?
if dxdiag uses getfileversioninfo then I should use that method, but how can I detect the latest version of directx? or maybe all and display all the installed versions.
if dxdiag uses getfileversioninfo then I should use that method, but how can I detect the latest version of directx? or maybe all and display all the installed versions.
It really depends on what you want the information for.
If the idea is to say 'You have Direct X Version ? Installed', then it looks like DirectXSetupGetVersion is the right answer. If there is a need to know about more than the core components then use the GetFileVersionInfo. I suppose you could do both, show the setup version and list the versions of the DLLs.
Trying to get the exact setup version from the DLL version info is complex and will fail in the future anyway. There is no way to predict the correspondance between future DLL versions and setup versions.
As far as I know, its only possible to have one version of DX installed. Someone could have a different version present on a drive, but not installed. Versions of DX are tied with versions of Windows.
If the idea is to say 'You have Direct X Version ? Installed', then it looks like DirectXSetupGetVersion is the right answer. If there is a need to know about more than the core components then use the GetFileVersionInfo. I suppose you could do both, show the setup version and list the versions of the DLLs.
Trying to get the exact setup version from the DLL version info is complex and will fail in the future anyway. There is no way to predict the correspondance between future DLL versions and setup versions.
As far as I know, its only possible to have one version of DX installed. Someone could have a different version present on a drive, but not installed. Versions of DX are tied with versions of Windows.
ASKER
getdxversion does it by trying to initialize COM objects which are avaiable only in certain versions of DX
I need the information to display it in a system info tool.
I need the information to display it in a system info tool.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.