dCar.WheelID(0) = Physics.AddVehicleWheelEx(dCar.VehicleID, 8, 0.31, 0.365, Vector(1, 0, 0), -0.85, -0.15, 1.125, , , , dCar.sLength, dCar.sShock, dCar.sSpring, dCar.Wheel(0))
This code is crashing out TV in C#,.NET,and VB6 for me. I have no idea why, I have used this code before. It will compile but not run.
.NET & VB6 crash out to desktop with no error report.
C#, gives me:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source: "MTV3D65"
StackTrace:
" at CTVPhysics.CreateVehicle(CTVPhysics* , Int32 )\r\n at MTV3D65.TVPhysics.CreateVehicle(Int32 iChassisBody)\r\n at VehicleStarterKit.frmCanvas.InitObjects() in C:\\Documents and Settings\\Owner\\Desktop\\VehicleStarterKit11\\VehicleStarterKit\\VehicleStarterKit\\VehicleStarterKit\\frmCanvas.cs:line 258\r\n at VehicleStarterKit.frmCanvas.frmCanvas_Load(Object sender, EventArgs e) in C:\\Documents and Settings\\Owner\\Desktop\\VehicleStarterKit11\\VehicleStarterKit\\VehicleStarterKit\\VehicleStarterKit\\frmCanvas.cs:line 119\r\n at System.Windows.Forms.Form.OnLoad(EventArgs e)\r\n at System.Windows.Forms.Form.OnCreateControl()\r\n at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)\r\n at System.Windows.Forms.Control.CreateControl()\r\n at System.Windows.Forms.Control.WmShowWindow(Message& m)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n at System.Windows.Forms.ContainerControl.WndProc(Message& m)\r\n at System.Windows.Forms.Form.WmShowWindow(Message& m)\r\n at System.Windows.Forms.Form.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)\r\n at System.Windows.Forms.Control.SetVisibleCore(Boolean value)\r\n at System.Windows.Forms.Form.SetVisibleCore(Boolean value)\r\n at System.Windows.Forms.Control.set_Visible(Boolean value)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at VehicleStarterKit.Program.Main() in C:\\Documents and Settings\\Owner\\Desktop\\VehicleStarterKit11\\VehicleStarterKit\\VehicleStarterKit\\VehicleStarterKit\\Program.cs:line 17\r\n at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"
More Detail:
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 CTVPhysics.CreateVehicle(CTVPhysics* , Int32 )
at MTV3D65.TVPhysics.CreateVehicle(Int32 iChassisBody)
at VehicleStarterKit.frmCanvas.InitObjects() in C:\Documents and Settings\Owner\Desktop\VehicleStarterKit11\VehicleStarterKit\VehicleStarterKit\VehicleStarterKit\frmCanvas.cs:line 258
at VehicleStarterKit.frmCanvas.frmCanvas_Load(Object sender, EventArgs e) in C:\Documents and Settings\Owner\Desktop\VehicleStarterKit11\VehicleStarterKit\VehicleStarterKit\VehicleStarterKit\frmCanvas.cs:line 119
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 VehicleStarterKit.Program.Main() in C:\Documents and Settings\Owner\Desktop\VehicleStarterKit11\VehicleStarterKit\VehicleStarterKit\VehicleStarterKit\Program.cs:line 17
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()
InnerException: