Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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)

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

Posted

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

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

  • *Experts*
Posted

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

"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
Posted

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)

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

  • Administrators
Posted

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?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...