Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: MTV3D65 -Attempted to read or write protected memory  (Read 1219 times)
programmer2005bigpimp185
Customers
Community Member
*****
Posts: 18


WWW
« on: October 26, 2007, 06:42:34 PM »

I Get this when i'm in fullscreen mode and eveything is loaded up and I want to close out the program..  i'll show the end code. I do, do a Scene.DestroyAll befor i go back in to the menu just because eveything was showing up. and just be for i close out the program I had to TV.SwitchWindowed() back to window just to see why it wouldn't close. be for i had to hit Alt F4 to close it out.. Smiley

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Soure: "MTV3D65" 
stackTrace: at CTVEngine.__dtor(CTVEngine* )
            at MTV3D65.TVEngine.Finalize()

   Do Until DoBoolean = False
            TV.Clear(False)
            Scene.RenderAll(True)
            ' With Screen2DImmediate
            '.Action_Begin2D()
            ' .Draw_Box(1, 1, 100, 100, Utilities.RGBA(1, 0, 0, 1))
            Select Case SElECT_MENUNAME
                Case "MainMenu"
                    Main_Menu()
                Case "Options"
                    Options()
                Case "SinglePlayerGame"
                    SinglePlayer()
                Case "HercBay"
                    Herc_Bay()
                Case "HercPick"
                    HercPick()
                Case "HercAddWP"
                    HercAddWP()
                Case "Userpick"
                    Userpick()
                Case "UserAddWP"
                    UserAddWP()
                Case "BRIEFING"
                    BRIEFING()
                Case "Start Mission"
                    CreateLandscape()   'P.S.   This Is where I load eveything up
                    PlayBoolean = True
                    SElECT_MENUNAME = "STRAT"
                Case "STRAT"
                    Do Until PlayBoolean = False
                        TV.Clear(False)
                        Scene.RenderAll(True)
                        UpdatePlayer()
                        Physics.Simulate(TV.AccurateTimeElapsed() * 0.005F)
                        If InputEngine.IsKeyPressed(CONST_TV_KEY.TV_KEY_F1) = True Then
                            TVP.CloseAllPackages()
                            Scene.DestroyAllActors()
                            Scene.DestroyAllLandscapes()
                            Scene.DestroyAllMeshes()
                            Scene.DestroyAllMinimeshes()
                            Scene.DestroyAllParticleSystems()
                            TV.Clear()
                            TV.RenderToScreen()
                            SElECT_MENUNAME = "HercBay"
                            PlayBoolean = False
                        End If
                        TV.RenderToScreen()
                    Loop
            End Select
            TV.RenderToScreen()
            If InputEngine.IsKeyPressed(CONST_TV_KEY.TV_KEY_ESCAPE) = True Then
                TV.SwitchWindowed()
                'TV.Init3DWindowed(Me.Handle.ToInt64, False)
            End If
            Application.DoEvents()
        Loop
        TV.SwitchWindowed()
        ' Set TV to Nothing
        ' TV.ReleaseAll()
        TV = Nothing

        ' End the application
        End

    End Sub
Logged

MenDAKE
Community Member
*
Posts: 402


« Reply #1 on: October 26, 2007, 06:48:40 PM »

By "fullscreen" do you mean true fullscreen, or do you mean when you maximize a windows form?
Logged
programmer2005bigpimp185
Customers
Community Member
*****
Posts: 18


WWW
« Reply #2 on: October 27, 2007, 11:48:54 AM »

True FullScreen! Smiley
.Init3DFullscreen(width, Height, 32, True, False, CONST_TV_DEPTHBUFFERFORMAT.TV_DEPTHBUFFER_BESTBUFFER, 0.7, Form1.Handle)
Logged

darqSHADOW
Administrator
Community Member
*****
Posts: 2737


« Reply #3 on: October 27, 2007, 11:51:41 AM »

Are you sure your render loop isn't being called after you call DestroyAll?

John
Logged

TrueVision3D Project Manager
The fast and simple way of 3D development.
programmer2005bigpimp185
Customers
Community Member
*****
Posts: 18


WWW
« Reply #4 on: October 27, 2007, 01:25:35 PM »

if you look at the code i posted you would know! Smiley no i'm not recalling the loop.. THE  (END) <i call will close out the program and that where i have a problem!
Logged

programmer2005bigpimp185
Customers
Community Member
*****
Posts: 18


WWW
« Reply #5 on: October 27, 2007, 01:39:22 PM »

ok i Fix it..

  .Init3DWindowed(Form1.Handle.ToInt64, False)
                  '  .SwitchFullscreen(width, Height, 32, CONST_TV_DEPTHBUFFERFORMAT.TV_DEPTHBUFFER_BESTBUFFER, Form1.Handle)
            '.Init3DFullscreen(width, Height, 32, True, False, CONST_TV_DEPTHBUFFERFORMAT.TV_DEPTHBUFFER_BESTBUFFER, 0.7, Form1.Handle)


what i was doing is .Init3dFullscreen when i'm post to Init3DWindowed Then do a .SwitchFullscreen so when I try to close out the program I don't get this (MTV3D65 -Attempted to read or write protected memory )
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks