Check to see if DirectX is installed fails... Please help!

Started by
5 comments, last by MadButch 23 years, 7 months ago
I added a check to my program to see if DirectX7 is installed. I''m using the code from the DXMisc example. My problem is, that when I run my game on NT 4, I get the following message BEFORE my WinMain has begun running (i checked with remote debugging). "The procedure entry point DirectDrawCreateEx could not be located in the dynamic link lybrary DDRAW.DLL." Could somebody tell me what I''m doing wrong?
Check my games out at:http://www.GamePlayHeaven.com
Advertisement
Hi!

As far as I know DirectDrawCreateEx was introduced with the IDirectDraw7 interface. You can actually compile your project because the .h files are from DX7SDK but your DIRECTX-DLLs are not DirectX7 because NT4 is usually DirectX3 or 5 only. Hence your app is not able to find the function in the DX-DLLs on startup.
If you want to use DX7 you have to switcht to Win98/ME or 2000.
Mad butch is right, NT4 DirectX version stopped at 3. not all of the Direct X commands will work, and directories wont initialize properly. try win 2000 or windows 98
I''m developing under Windows 2000 and Win 98 SE. My development systems all work fine.

But I''m adding a check to the game, that verifys if DX7 is installed. When I run the sample from DX7SDK it works fine, but when I add that check to my program, and run it on a NT 4 system, I get that error message before my code has started running...

I''ve got no idea why this is... Maybe it''s some compiler setting?
Check my games out at:http://www.GamePlayHeaven.com
The reason you are getting that error before your app starts is because you''ve linked directly to the dll. If you want to avoid the problem, you''ll need to use LoadLibrary instead, and then use GetProcAddress to get the address of DirectDrawCreate or DirectDrawCreateEx. It''s a bit more code, but it lets you provide the user with a better error message than the one you''re seeing right now, and it also let''s you choose at run time how you are going to create your DX objects.



Mark Fassett
Laughing Dragon Entertainment
http://www.laughing-dragon.com

Mark Fassett

Laughing Dragon Games

http://www.laughing-dragon.com

Thanks... that was the perfect answer for me!

It wasn''t immediatly clear, but it steered my thoughts in the right direction. I now fully understand what was going on, and what should be going on. On the DX example part: Naming that function exactly the same as the one in the dll was misleading!

After I figured it out, I reread your message, and it''s all there

Thanks for the big help!
Check my games out at:http://www.GamePlayHeaven.com
Personally, I just use the standard COM CoCreateInstance to create the objects, and as I''m not statically linking to anything, it will run fine anywhere.

I don''t care if DirectX7 is installed or not, as long as I can create my IDirectDraw7 interface . Hell, if it fails I just display an msgbox saying something like "Hey, I couldn''t create a DirectDraw 7 object, so DirectX 7 isn''t properly installed. Try re-installing DirectX 7". I then exit gracefully.

Hey, it works for me, (and as we haven''t taken command of the display yet, the msgbox is fine, (just make sure you setup ddraw last, and the msgboxes will be fine for errors in the other sections of you startup too).

Waassaap!!
Waassaap!!

This topic is closed to new replies.

Advertisement