help with drawframe
Posted: Tue Dec 22, 2009 10:35 am
Hello!!!
I`m new using Optitrack cameras. I`m doing project and I want that camera images show in form panel. This is my code:
pCamera->Start();
INPCameraFrame * pCameraFrame;
pCamera->GetFrameById(1, &pCameraFrame);
pCamera->DrawFrame(pCameraFrame,this->panel1->Handle.ToInt32());
pCamera is INPCamera * pCamera and panel1 is System.Windows.Forms.Panel
when I try to run, the program return a box message with the next error message:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at optitracks.Camera.Create(INPCamera* pCamera) in c:\documents and settings\user\desktop\optitracks\optitracks\camera.cpp:line 14
at optitracks.Form1.InitializeData() in c:\documents and settings\user\desktop\optitracks\optitracks\form1.h:line 141
at optitracks.Form1.button1_Click(Object sender, EventArgs e) in c:\documents and settings\user\desktop\optitracks\optitracks\form1.h:line 153
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I'm using visual 2005 and the project is in windows forms
any idea?? can you help me??
thanks!!
I`m new using Optitrack cameras. I`m doing project and I want that camera images show in form panel. This is my code:
pCamera->Start();
INPCameraFrame * pCameraFrame;
pCamera->GetFrameById(1, &pCameraFrame);
pCamera->DrawFrame(pCameraFrame,this->panel1->Handle.ToInt32());
pCamera is INPCamera * pCamera and panel1 is System.Windows.Forms.Panel
when I try to run, the program return a box message with the next error message:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at optitracks.Camera.Create(INPCamera* pCamera) in c:\documents and settings\user\desktop\optitracks\optitracks\camera.cpp:line 14
at optitracks.Form1.InitializeData() in c:\documents and settings\user\desktop\optitracks\optitracks\form1.h:line 141
at optitracks.Form1.button1_Click(Object sender, EventArgs e) in c:\documents and settings\user\desktop\optitracks\optitracks\form1.h:line 153
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I'm using visual 2005 and the project is in windows forms
any idea?? can you help me??
thanks!!