ThePentiumGuy Posted February 19, 2004 Posted February 19, 2004 hi, when i run my program (something i made in d3d), i get this error An unhandled exception of type 'System.StackOverflowException' occurred in Unknown Module. i have no idea how to fix this error lol, sry for being so vague but i cant exactly Pinpoint wehre the error originated.. (it says unknown module) if anyone has encountered this problem, can you please explain where it may originate ( & if possible, how to fix it) Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Moderators Robby Posted February 19, 2004 Moderators Posted February 19, 2004 Are you in an endless loop somewhere or dividing some int ? Quote Visit...Bassic Software
ThePentiumGuy Posted February 19, 2004 Author Posted February 19, 2004 i think endless loop might be it :-) Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
ThePentiumGuy Posted February 19, 2004 Author Posted February 19, 2004 wow.. i tracked the problem down the program seemed to be continuously repeating this line: Public alex As New clsSprite() 'this is the first variable in the declarations, so i dont see why it would go through a loop the statement that (for some reason) caused it to loop: (in clsSprite) i said: Inherits D3D_Engine.D3DGraphicsClass 'the class in which i declared that variable really odd.. i ahve no idea why vb would do that Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Moderators Robby Posted February 20, 2004 Moderators Posted February 20, 2004 Were you instantiating the class within a loop? Quote Visit...Bassic Software
*Experts* Nerseus Posted February 20, 2004 *Experts* Posted February 20, 2004 You can view the Call Stack (ctrl-alt-c) when your program breaks. It will show you all the code that's been called. I would guess you'll see two lines of code (or maybe a few more) being called over and over. One of them should provide clues. If you can't get it, let us see some more of your code... -Nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
ThePentiumGuy Posted February 20, 2004 Author Posted February 20, 2004 hey, thanks for the replies.. ctrl alt c doesnt work (maybe that's a vs.net 2003 thing?) o_O but here's my code Public Class D3DGraphicsClass Public alex As New clsSprite() End Class Public Class clsSprite Inherits D3DGraphicsClass End Class 'aand finally form1's declarations: Dim Game As New D3DGraphicsClass() -(note: this code is the shortened version of my otehr code... -but: i actually tried using this same exact code and it still gives the error) Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
samsmithnz Posted February 20, 2004 Posted February 20, 2004 When your application breaks on the stack overflow error, try going to Debug>Windows>Call Stack to see the same thing Quote Thanks Sam http://www.samsmith.co.nz
Administrators PlausiblyDamp Posted February 20, 2004 Administrators Posted February 20, 2004 Public Class D3DGraphicsClass Public alex As New clsSprite() End Class Public Class clsSprite Inherits D3DGraphicsClass End Class 'aand finally form1's declarations: Dim Game As New D3DGraphicsClass( clsSprite inherits D3DGraphicsClass - every time you create a clsSprite it calls the D3DGraphicsClass new method - and in it's new method you are creating a new sprite etc. Is there a reason why you are doing it this way? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
ThePentiumGuy Posted February 20, 2004 Author Posted February 20, 2004 ohh! actually there's no reason why im doing it that way.. lol i didnt realize that it would create the variables again where would i instantiate clsSprite though? edit: never mind, i figured it out :-) thanks for ur help guys Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.