beloveds 0 Newbie Poster

Hi, everybody

First of all, i should say i am new at OpenGL programming and thanks to those who may help to solve my problem :)

The thing is, i was developing an application which is named Articulated Robot Arm (some of you guys may familiar with this). Everything was going perfect, but last night i have upgraded my OS from WinXP to Vista Ultimate 64-bit. I have opened my project to keep going but, i got the following exception in my code.

System.TypeInitializationException was unhandled
  Message="The type initializer for 'CsGL.OSLib' threw an exception."
  Source="csgl"
  TypeName="CsGL.OSLib"
  StackTrace:
       at CsGL.OSLib..ctor()
       at CsGL.OpenGL.OpenGL..ctor()
       at CsGL.OpenGL.OpenGL_Extension..ctor()
       at CsGL.OpenGL.GLU..ctor()
       at CsGL.OpenGL.GLUT..ctor()
       at CsGL.OpenGL.GL..ctor()
       at CsGL.OpenGL.OpenGLContext..ctor()
       at CsGL.OpenGL.ControlGLContext..ctor(Control c)
       at CsGL.OpenGL.OpenGLControl.CreateContext()
       at CsGL.OpenGL.OpenGLControl.get_Context()
       at CsGL.OpenGL.OpenGLControl.OnSizeChanged(EventArgs e)
       at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
       at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height)
       at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
       at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
       at System.Windows.Forms.Layout.DefaultLayout.xLayoutDockedControl(IArrangedElement element, Rectangle newElementBounds, Boolean measureOnly, Size& preferredSize, Rectangle& remainingBounds)
       at System.Windows.Forms.Layout.DefaultLayout.LayoutDockedControls(IArrangedElement container, Boolean measureOnly)
       at System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)
       at System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)
       at System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)
       at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
       at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
       at System.Windows.Forms.Control.PerformLayout()
       at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
       at System.Windows.Forms.Layout.DefaultLayout.SetDock(IArrangedElement element, DockStyle value)
       at System.Windows.Forms.Control.set_Dock(DockStyle value)
       at ArticulatedRobotArm.Form1..ctor() in F:\asd\Desktop\ArticulatedRobotArm\ArticulatedRobotArm\ArticulatedRobotArm\Form1.cs:line 19
       at ArticulatedRobotArm.Program.Main() in F:\asd\Desktop\ArticulatedRobotArm\ArticulatedRobotArm\ArticulatedRobotArm\Program.cs:line 17
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.BadImageFormatException
       Message="An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
       Source="csgl"
       StackTrace:
            at CsGL.OSLib.csgl_sys_initAssert(ASSERT a, ASSERT_THROW at)
            at CsGL.OSLib..cctor()
       InnerException:

The exception is generated in this section of my code:

public partial class Form1 : Form
    {
        MyView viewRef;
        public Form1()
        {
            InitializeComponent();
            viewRef = new MyView();
            this.viewRef.Parent = OpenGLPanel;
            [B]this.viewRef.Dock = DockStyle.Fill;[/B] // <- Here
            
        }

I really have no idea what the problem is.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.