Program works, exe doesnt?
Program works, exe doesnt?
Ive written a program that uses DirectX 9. It works fine in the IDE and behaves as it should when I run it, but when I compile it to an exe, then try to run the exe I get an error (a messagebox that I defined in my code, so I know which bit is causing the problem.) What could be causing this? I dont really want to put my code up, but I can tell you that the Direct3D device creation is failing.
Like I say it works in the IDE but why not when executed seperately?
Like I say it works in the IDE but why not when executed seperately?
Mark my words, when you least expect it, your uppance will come...
-
- Enthusiast
- Posts: 252
- Joined: Fri Feb 20, 2004 5:43 pm
Im not using the [OGRE] Engine3d.dll, Im writing a 3d engine myself.
Double checked with the D3Dspy9.dll which monitors what the application is doing - it calls the CreteDevice method but fails with a D3DERR_INVALIDCALL code. The definition of this error for this call is: "The method call is invalid. For example, a method's parameter may have an invalid value."
Oh how I wish Codemonger was here now
I just cant understand why this is happening - all of the required DLL's are present in the program folder - otherwise the program would fail much earlier when I open the libraries becuase I set up HandleError procedures to deal with any problems.
Double checked with the D3Dspy9.dll which monitors what the application is doing - it calls the CreteDevice method but fails with a D3DERR_INVALIDCALL code. The definition of this error for this call is: "The method call is invalid. For example, a method's parameter may have an invalid value."
Oh how I wish Codemonger was here now

I just cant understand why this is happening - all of the required DLL's are present in the program folder - otherwise the program would fail much earlier when I open the libraries becuase I set up HandleError procedures to deal with any problems.
Mark my words, when you least expect it, your uppance will come...
-
- Enthusiast
- Posts: 252
- Joined: Fri Feb 20, 2004 5:43 pm
Checked it already. I used my own error handling procedures using the Win32 API. Ive been through the compiler options but I cant see anything that might cause a problem...
[edit] My main engine file had inline ASM support turned on so I turned it off and recompiled...no difference
[edit] My main engine file had inline ASM support turned on so I turned it off and recompiled...no difference

Mark my words, when you least expect it, your uppance will come...
Another update and an informative discovery:
Turning the debugger off while in the IDE, then running the program, causes the same crash as the exe has - what does this mean? It didnt hit me until I was glancing through the menu then I remembered that the debugger isnt included with the compiled exe, yet Ive been using it to track down the bugs (damn helpful it has been aswell). So is this some kind ofconflict or what? Its really slowing me down (I'm on a roll at the moment), any help is appreciated
Turning the debugger off while in the IDE, then running the program, causes the same crash as the exe has - what does this mean? It didnt hit me until I was glancing through the menu then I remembered that the debugger isnt included with the compiled exe, yet Ive been using it to track down the bugs (damn helpful it has been aswell). So is this some kind ofconflict or what? Its really slowing me down (I'm on a roll at the moment), any help is appreciated

Mark my words, when you least expect it, your uppance will come...
Maybe (just an idea) you have something like:
If so, "ThatFunction()" will be called when debugger is on, not when it's off.
Code: Select all
Debug ThatFunction()
If you compile from the command line with the /COMMENTED flag then a Purebasic.asm file will be created in the compiler directory. Just copy and rename that file to somewhere else.
If you know a bit of ASM then you'll find the commented file great. It clearly shows how each line of purebasic code has been compiled into ASM.
There is nothing quite like it for troublesheeting these tricky bugs.
http://www.purebasic.com/documentation/ ... piler.html
If you know a bit of ASM then you'll find the commented file great. It clearly shows how each line of purebasic code has been compiled into ASM.
There is nothing quite like it for troublesheeting these tricky bugs.
http://www.purebasic.com/documentation/ ... piler.html