Get DirectX-Version

Share your advanced PureBasic knowledge/code with the community.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Get DirectX-Version

Post by BackupUser »

Broken on newest Windows

Restored from previous forum. Originally posted by Rings.

;GetDX-Version dsetup.dll is needed !
;
; The VB-Declares:
;Private Declare Function DirectXSetup Lib "dsetup.dll" Alias "DirectXSetupA" (ByVal hWnd As Long, ByVal lpszRootPath As String, ByVal dwFlags As Long) As Long
;Private Declare Function DirectXSetupGetVersion Lib "dsetup.dll" (dwVersion As Long, dwRevision As Long) As Long
;
lMajor.l=0
lMinor.l=0
dummy.l=0
If OpenDLL(0,"dsetup.dll"); Open the DLL
If DLLFunction(0,0,"DirectXSetupGetVersion") ; Register function
CallDLL2(0,@lMajor,@lMinor)
dummy.l=lMajor -$40000
MessageRequester("Info","DX-version: " + Str(lMajor) +" = "+Str(dummy),0)
EndIf
EndIf

;This is for Install DX !
;You may well need To change the string in the middle....
;R = DirectXSetup(MehWnd, "c:\windows\Temp\Dx\", 65560)


Getting better with a little help from my friends....thx Siggi
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Coooool... DirectX for PureBasic

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Sorry man,
I have Direct X on W98SE (on work) but no dsetup.dll

I also put a 'MessageRequester("Error","no DX found",0)' before the last 'EndIf' but nothing happens. That's strange...

The DirectX Diagnostic Tool says:
Operating System: Microsoft Windows 98(4.10, Build 2222)
DirectX Version : DirectX 8.0 (4.08.00.0400)

Notes: No problems found

DirectDraw Acceleration : Enabled
Direct3D Acceleration : Enabled
AGP Texture Acceleration: Enabled



Have a nice day...
Franco

Sometimes you have to go a lonely way to accomplish genius things.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

yes, thats a trashy fast code-snippet.
I forgot to notice that you need the DLL-Lib from Mr.Skunk and the
dsetup.dll in the system-directory of you windows.
This sample is converted from a VB-Example.
See more(And the dsetup.dll) at http://64.23.12.52//TUT_DX7_General.asp



Getting better with a little help from my friends....thx Siggi
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

As of 3rd Feb 2007, the above tip no longer works (due to using an old lib
that is no longer available, and probably incompatible with PureBasic v4).
Anyone have another approach to doing it? I note that DSETUP.DLL is not
present on Windows XP Professional too. :(
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Heathen
Enthusiast
Enthusiast
Posts: 498
Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..

Post by Heathen »

PB wrote:As of 3rd Feb 2007, the above tip no longer works (due to using an old lib
that is no longer available, and probably incompatible with PureBasic v4).
Anyone have another approach to doing it? I note that DSETUP.DLL is not
present on Windows XP Professional too. :(
Hey PB, have you tried using the registery?

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX

Code: Select all

4.02.0095        DirectX 1.0  
4.03.00.1096     DirectX 2.0 / 2.0a  
4.04.0068 / 69   DirectX 3.0 / 3.0a  
Never Released   DirectX 4.0  
4.05.00.0155     DirectX 5.0  
4.05.01.1721 / 1998     DirectX 5.0 (Released with Windows 98)  
4.06.02.0436     DirectX 6.0  
4.07.00.0700     DirectX 7.0  
4.07.00.0716     DirectX 7.0a  
4.08.00.0400     DirectX 8.0  
4.08.01.0810  
4.08.01.0881     DirectX 8.1  
4.09.0000.0900   DirectX 9.0  
4.09.0000.0901   DirectX 9.0a  
4.09.0000.0902   DirectX 9.0b  
Source:
http://www.vbgamer.com/msgboard/topic.asp?TOPIC_ID=210
I love Purebasic.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX

Okay, my Registry entry says 4.09.00.0904 which obviously relates to 9.0c,
but the problem is future versions would not be recognized. I was hoping
there'd be a string in the Registry saying "9.0c" somewhere. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Heathen
Enthusiast
Enthusiast
Posts: 498
Joined: Tue Sep 27, 2005 6:54 pm
Location: At my pc coding..

Post by Heathen »

PB wrote:> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DirectX

Okay, my Registry entry says 4.09.00.0904 which obviously relates to 9.0c,
but the problem is future versions would not be recognized. I was hoping
there'd be a string in the Registry saying "9.0c" somewhere. :)
Yeah, that's true :/
I love Purebasic.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

... future versions would not be recognized ...
where is the problem?

4.09.00.0904
Version - Build/release/whatever...

so check for >= 7 if you want to be sure to run with DX7
oh... and have a nice day.
Post Reply