Solved

Simple DirectX application won't run on anyone else's computer

Posted on 2004-08-29
8
223 Views
Last Modified: 2011-09-20
I have a simple C++ DirectX project.  It makes a blue rectangle.  Straight out of Wendy Jones' "Beginning DirectX 9".

It compiles and runs fine on my computer.  I have the latest version of the SDK installed, 9.0c (Summer 2004) that came out last week.


However, when I send the small 120k executable (in Debug configuration) or the 44k executable (in Release configuration) to anyone else and they execute it, then it just flickers on and off.

I pinpointed the problem to this line of the code:

      // Create the DirectX object
      if( NULL == (pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
      {
            return false;
      }

The Direct3DCreate9 is returning NULL on everyone's computer but mine.  I've tried installing the DirectX Runtime that came in the "Redist" folder that came with the SDK on both of the other computers, and still, both fail to create the DirectX object.

I'm running Windows Server 2003, Visual Studio .NET 2003 and DirectX 9.0c SDK (Summer 2004)

One of the computers I tested on was running Windows Server2003 and DirectX 9.0b.
I upgraded it to 9.0c using the files in the "Redist" folder and now it runs the 9.0c, but still fails to create the object.

The second computer I tested on is running Windows XP SP2 and DirectX 9.0c.
The program fails to create the DirectX object there too.

dxdiag didn't return anything interesting.

Any ideas?  Why would DirectX applications developed on my workstation not run on other workstations?
0
Comment
Question by:asoofi
[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
8 Comments
 
LVL 2

Expert Comment

by:cmreichl
ID: 11932650
Haven't had time to read this fully yet, but first thing that pops in my head is to run dxdiag on those other machines and make sure that dx9 is working properly... that being said, we can know for sure if its code or dx.

-Chris
0
 

Author Comment

by:asoofi
ID: 11933432
dxdiag didn't return anything interesting on any of the computers.
everything's running fine, "no problems found."
0
 
LVL 5

Accepted Solution

by:
info_expert earned 250 total points
ID: 11995388
Hi,

First of all make sure that the directx version 9.0 is installed on others computer.

Also make sure that you static build the project instead of shared dlls (Hint: In the menue, click at project then settings and look there at shared dlls , change it to static build,


Most important is that you must use the directx libraries using relative path in project settings instead of including them from tools->options. It will help you identify the dlls you use.

Regards
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:skeid21
ID: 12193004
it may be worth to check if you accidentaly built the project as a .net application.  I have heard of some problems if the framwork is not the correct version that the compiler used to build on, but I havn't heard about anyone doing directx  in a .net program.
0
 

Expert Comment

by:evolutional
ID: 12199501
Is the grapics card you're attempting to run it on fully supportive of DirectX9?

Instead of using the release version of DirectX, you should go into control panel and open the DirectX applet, from here turn on the debug output from DirectX to maximum. This will only work if you have installed the debug runtimes of DX which come with the SDK, so that shouldn't be a problem.

When you run your program in debug mode, watch your debug output window and you'll see DirectX is a lot more verbose about it's operations. It should give you an error code or message that you will be able to use to search for your problem.
0
 

Assisted Solution

by:Groby
Groby earned 250 total points
ID: 12294755
Heh - I just fixed that in my application. Basically, if you run with the summer SDK, people need to have the summer version installed - and pretty much nobody has, yet.

So, when calling Direct3DCreate9, pass in an older version. Yes, MS says you should use D3D_SDK_VERSION. However, if you run the summer SDK, you want to pass in D3D9b_SDK_VERSION instead.

Hope that helps
 - Robert
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get correct installed directX version? 3 806
FPS using mouse to move rather than keys in Unity 3d 2 233
bunnyEars2 challenge 6 181
Need a nodal sequencing tool 3 129
What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

732 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