Program works, exe doesnt?

Everything else that doesn't fall into one of the other PB categories.
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

Yes, I tried it again just now, still nothing...
Mark my words, when you least expect it, your uppance will come...
filperj
User
User
Posts: 77
Joined: Tue Sep 16, 2003 8:53 pm
Location: Nevers(France)

Post by filperj »

Did you try with "config tools" in the IDE?
Image
(the first field is the path to PBCompiler.exe)
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

Thanks filperj, that did it. I just have to try and decipher this ASM while knowing very little ASM at all. Quite a challenge. Thanks again filperj :)
Mark my words, when you least expect it, your uppance will come...
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Put this in your code somewhere

Post by Fangbeast »

Moonshine wrote:Cheers, I'll check it out :)

Code: Select all

;-; Global error handler, very 1st line (Danilo's suggestion)

OnErrorGoto(?ErrorHandler)                                  
Then put this somewhere down the bottom. It might trap whatever the error is

Code: Select all

;-; Danilo's suggestion to trap some errors occuring

ErrorHandler:

  Module.s = GetErrorModuleName()
  Errnum.s = StrU(GetErrorLineNR(), #LONG)

  MessageRequester("FATAL ERROR", "There is an error in " + Module.s + ", at line " + Errnum.s, #MB_ICONERROR)
  
End
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

Thanks for the suggestion, it's almost 4 in the morning over here (i'm not a very good sleeper :roll:) so I'll test it tomorrow. Thanks! :)
Mark my words, when you least expect it, your uppance will come...
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

I got an "Error in Main Module at line 0". And to see if it was just my code, I took one of codemongers old DX9 examples ("VertexBuffer") and swapped his include files for mine. The app did the same, it just quit before ithad started. This makes me think that its a compiler bug rather than a coding error, as I seem to have tried everything I know. I might consider either a)uninstalling the current one (v3.91, updated from 3.90), then installing 3.90 and compiling, or b)downloading the complete 3.91 installer and trying that, although it shouldnt really make a difference.
Mark my words, when you least expect it, your uppance will come...
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

Remember that you have to enable 'Linenumbering' if you want to know on which line your program failed.. just in case you've not already done that..
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

I'll try with linenumbering. Anyways, heres something new - I used the DirectX debug output utility to monitor just what was going on ... this is what it said

*Note - only the first bit appeared during runtime (the PresentationInterval part, which is set perfectly fine to my knowledge), the rest bout memory appeared when I closed the program.

Code: Select all

2792: Direct3D9: (ERROR) :Invalid value for PresentationInterval. ValidatePresentParameters fails.
2792: Direct3D9: (ERROR) :Memory still allocated!  Alloc count = 4
2792: Direct3D9: (ERROR) :Current Process (pid) = 00000ae8
2792: Direct3D9: (ERROR) :Memory Address: 00b738cc lAllocID=1 dwSize=000047f8, R
eturnAddr=009a3796 (pid=00000ae8)
2792: Direct3D9: (ERROR) :Memory Address: 00b7a75c lAllocID=9 dwSize=0000180c, R
eturnAddr=0099e1e9 (pid=00000ae8)
2792: Direct3D9: (ERROR) :Memory Address: 00b7bf8c lAllocID=10 dwSize=00000008,
ReturnAddr=0099e289 (pid=00000ae8)
2792: Direct3D9: (ERROR) :Memory Address: 00b7bfbc lAllocID=11 dwSize=000009c0,
ReturnAddr=009a2f45 (pid=00000ae8)
2792: Direct3D9: (ERROR) :Total Memory Unfreed From Current Process = 27084 bytes
Update: Memory allocation problems fixed (already, 12 minutes after posting) :wink:
Mark my words, when you least expect it, your uppance will come...
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post by Moonshine »

PRAISE THE GOOD LORD!!! Ive done it!!!! :D

You will not believe how simple it was.

Right, for anything to be presented to the screen or a window with D3D, and to create a rendering device, you must first fill a structure called D3DPRESENT_PARAMETERS. Well the failure I was getting was that PresentationInterval (the last member of the D3DPRESENT_PARAMETERS structure) was invalid, even though i knew it wasnt. So my thought was that it had something to do with the structure itself - I didnt think it mattered, but theres 2 members of the structure (Windowed, and EnableAutoDepthStencil) that are booleans in the actual C++ structure. So I thought it might be a better idea to set them to byte rather than long. This must have caused an error with the size of the structure which made the last member invalid.

As a long shot I set the two from .b to .l and voila! Instant compile without the debugger!

Just goes to show how much difference a few bytes can make. Well, I hope we can all learn something from this! Massive thanks to everyone who has provided suggestions and help :)
Mark my words, when you least expect it, your uppance will come...
Post Reply