Page 2 of 2
Posted: Wed Aug 25, 2004 4:15 pm
by Moonshine
Yes, I tried it again just now, still nothing...
Posted: Wed Aug 25, 2004 5:36 pm
by filperj
Did you try with "config tools" in the IDE?

(the first field is the path to PBCompiler.exe)
Posted: Wed Aug 25, 2004 6:33 pm
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

Put this in your code somewhere
Posted: Thu Aug 26, 2004 2:44 am
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
Posted: Thu Aug 26, 2004 3:47 am
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!

Posted: Thu Aug 26, 2004 10:48 am
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.
Posted: Thu Aug 26, 2004 12:08 pm
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..
Posted: Thu Aug 26, 2004 12:18 pm
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)

Posted: Thu Aug 26, 2004 6:30 pm
by Moonshine
PRAISE THE GOOD LORD!!! Ive done it!!!!
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
