Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Deathscythe

Question about DXversion checking

This topic is 5963 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

2 Questions: 1)When I create a DX application, I want it to check the current verision of DX is installed on the machine. Is there someway I could do somethink like:
  
if(DXversion < 8.1)
{
MessageBox(NULL, "Older version of Direct X detected, Exiting...", "Warning:", MB_OK | MB_ICONEXCLEMATION);
ExitCode...;
}
else
continue...;
  
2) Also, is there some way to check if another copy of the same application is running so I can say:
  
if(/*Another copy of same program is running*/)
{
MessageBox(NULL, "You already have this program running. Exiting...", "Warning:", MB_OK | MB_ICONEXCLEMATION);
ExitCode...;
}
else
continue...;
  
Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
You have the source code of GetDXVersion in the SDK.

For the single instance :

static inline bool InstanceRunning ( )
{
HANDLE hMutex = CreateMutex(NULL, false, "My_Unique_Mutex_Name");

if ( hMutex)
{
DWORD dwWait = WaitForSingleObject( hMutex, 10 ) ;

switch ( dwWait )
{
case WAIT_OBJECT_0:
break;
case WAIT_TIMEOUT:
return true;
case WAIT_FAILED:
break;
}
}

return false;
}



Laurent - http://www.lafaqmfc.com/
My little game: http://www.lafaqmfc.com/home/play_starshooter.htm

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!