Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Bug #472: AccessViolationException in TVMesh.CreateXXX
Product:
TV3D SDK 6.5
Language:
C#
Current State:
Closed
Resolution:
Not a Bug
Created On:
August 2nd, 2005
Last Modified:
August 3rd, 2005
Reported By:
Omnigames
When attempting to create a primitive as a mesh, VS2005 generates the error below. Note that the TVEngine() and other engine components have already been created and configured before the code below gets executed. (Uncomment other lines below to see the error with different primitives.)

code:
Mesh = new TVMesh();
Mesh.CreateBox( 1.0f, 1.0f, 1.0f );
//Mesh.CreateCone( 1.0f, 1.0f, 1, false );
//Mesh.CreateCylinder( 1.0f, 1.0f, 1 );
//Mesh.CreateSphere( 1.0f );

error:
System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="MTV3D65"
StackTrace:
at CTVMesh.CreateBox(CTVMesh* , Single , Single , Single , Boolean )
at MTV3D65.TVMesh.CreateBox(Single fWidth, Single fHeight, Single fDepth)
at MyGame.WorldSceneForm.StartGame(Int32 mapType) in C:\MyGame\WorldSceneForm.cs:line 469
at MyGame.WorldSceneForm.RunGame() in C:\MyGame\WorldSceneForm.cs:line 588
at MyGame.WorldSceneForm.WorldSceneForm_Load(Object sender, EventArgs e) in C:\MyGame\WorldSceneForm.cs:line 649
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at MyGame.Program.Main() in C:\MyGame\Program.cs:line 16
at System.AppDomain.nExecuteAssembly(Assembly assembly, String args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Comments:

Posted by SylvainTV on August 3rd, 2005 at 2:25 PM
All has been configured except...

mesh = scene.CreateMeshBuilder(name);

it was the same in tv6.2, it's still like that in tv6.5 :)

there should be some more error handling but well... it adds checks. and too many checks = slow.
Posted by Omnigames on August 4th, 2005 at 12:07 AM
Thanks! I agree it's better to have more speed than checks. :)