Click here to Skip to main content
15,893,644 members
Home / Discussions / C#
   

C#

 
Generalinserting radiobutton status dynamically in app.config Pin
Member 102635197-Nov-13 20:33
Member 102635197-Nov-13 20:33 
GeneralRe: combobox in c# Pin
CodeBlack7-Nov-13 21:13
professionalCodeBlack7-Nov-13 21:13 
GeneralRe: combobox in c# Pin
Member 102635197-Nov-13 22:03
Member 102635197-Nov-13 22:03 
GeneralRe: combobox in c# Pin
CodeBlack7-Nov-13 22:07
professionalCodeBlack7-Nov-13 22:07 
GeneralRe: combobox in c# Pin
Member 102635197-Nov-13 22:28
Member 102635197-Nov-13 22:28 
GeneralRe: combobox in c# Pin
CodeBlack7-Nov-13 21:38
professionalCodeBlack7-Nov-13 21:38 
AnswerRe: combobox in c# Pin
Bernhard Hiller7-Nov-13 21:16
Bernhard Hiller7-Nov-13 21:16 
QuestionCannot evaluate expression because a native frame is on top of the call stack Pin
josephdalebert7-Nov-13 3:17
josephdalebert7-Nov-13 3:17 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using OtherLibs;
using CxCore;


namespace oneMoreTry
{
public partial class Form1 : Form
{
private CvCapture VideoCapture;

private IplImage frame;
private IplImage imgMain;

bool capture = false;

public Form1()
{
InitializeComponent();
}

private void Form1_KeyDown(object sender, KeyEventArgs e)
{
capture = true;
}

private void btnVideo_Click(object sender, EventArgs e)
{
double vidWidth, vidHeight;

VideoCapture = highgui.CvCreateCameraCapture(0);

if (btnVideo.Text.CompareTo("Start Video") == 0)
{

if (VideoCapture.ptr == IntPtr.Zero)
{
MessageBox.Show("badtrip ah!!!");
return;
}

btnVideo.Text = "Stop Video";

highgui.CvSetCaptureProperty(ref VideoCapture, highgui.CV_CAP_PROP_FRAME_WIDTH, 640);
highgui.CvSetCaptureProperty(ref VideoCapture, highgui.CV_CAP_PROP_FRAME_HEIGHT, 480);

highgui.CvQueryFrame(ref VideoCapture);

vidWidth = highgui.cvGetCaptureProperty(VideoCapture, highgui.CV_CAP_PROP_FRAME_WIDTH);
vidHeight = highgui.cvGetCaptureProperty(VideoCapture, highgui.CV_CAP_PROP_FRAME_HEIGHT);

picBoxMain.Width = (int)vidWidth;
picBoxMain.Height = (int)vidHeight;

timerGrab.Interval = 42;
timerGrab.Enabled = true;
}

else
{
btnVideo.Text = "Start Video";
timerGrab.Enabled = false;

if (VideoCapture.ptr == IntPtr.Zero)
{
highgui.CvReleaseCapture(ref VideoCapture);
VideoCapture.ptr = IntPtr.Zero;
}
}
}


private void timerGrab_Tick(object sender, EventArgs e)
{
frame = highgui.CvQueryFrame(ref VideoCapture);

if (frame.ptr == IntPtr.Zero)
{
timerGrab.Stop();
MessageBox.Show("??");
return;
}

imgMain = cxcore.CvCreateImage(cxcore.CvGetSize(ref frame),8,3);

picBoxMain.Image = highgui.ToBitmap(imgMain, false);

cxcore.CvReleaseImage(ref imgMain);
}
}
}


I have this code and when i step through the debugger to find the problem.

The problem i encounter is like this, it says that Cannot evaluate expression because a native frame is on top of the call stack.

when i break the debugger. the program stops at this point of the code. frame = highgui.CvQueryFrame(ref VideoCapture);

i dont know how to or what to revised in the code.
AnswerRe: Cannot evaluate expression because a native frame is on top of the call stack Pin
Alan Balkany7-Nov-13 4:40
Alan Balkany7-Nov-13 4:40 
GeneralRe: Cannot evaluate expression because a native frame is on top of the call stack Pin
josephdalebert7-Nov-13 5:22
josephdalebert7-Nov-13 5:22 
GeneralRe: Cannot evaluate expression because a native frame is on top of the call stack Pin
Alan Balkany7-Nov-13 5:25
Alan Balkany7-Nov-13 5:25 
GeneralRe: Cannot evaluate expression because a native frame is on top of the call stack Pin
josephdalebert7-Nov-13 5:41
josephdalebert7-Nov-13 5:41 
GeneralRe: Cannot evaluate expression because a native frame is on top of the call stack Pin
Alan Balkany7-Nov-13 5:45
Alan Balkany7-Nov-13 5:45 
GeneralRe: Cannot evaluate expression because a native frame is on top of the call stack Pin
josephdalebert7-Nov-13 6:05
josephdalebert7-Nov-13 6:05 
QuestionCustom configuration in app.config Pin
Member 102635196-Nov-13 23:29
Member 102635196-Nov-13 23:29 
AnswerRe: Custom configuration in app.config Pin
Abhinav S7-Nov-13 0:13
Abhinav S7-Nov-13 0:13 
GeneralRe: Custom configuration in app.config Pin
Member 102635197-Nov-13 0:48
Member 102635197-Nov-13 0:48 
AnswerRe: Custom configuration in app.config Pin
Abhinav S7-Nov-13 0:57
Abhinav S7-Nov-13 0:57 
GeneralRe: Custom configuration in app.config Pin
Member 102635197-Nov-13 1:19
Member 102635197-Nov-13 1:19 
GeneralRe: Custom configuration in app.config Pin
Dave Kreskowiak7-Nov-13 1:29
mveDave Kreskowiak7-Nov-13 1:29 
GeneralRe: Custom configuration in app.config Pin
Member 102635197-Nov-13 19:58
Member 102635197-Nov-13 19:58 
AnswerRe: Custom configuration in app.config Pin
Richard MacCutchan7-Nov-13 0:53
mveRichard MacCutchan7-Nov-13 0:53 
QuestionC# code to fetch all attributes of an element Pin
AshwiniSH6-Nov-13 23:09
professionalAshwiniSH6-Nov-13 23:09 
AnswerRe: C# code to fetch all attributes of an element Pin
Pete O'Hanlon6-Nov-13 23:41
mvePete O'Hanlon6-Nov-13 23:41 
AnswerRe: C# code to fetch all attributes of an element Pin
Abhinav S7-Nov-13 0:15
Abhinav S7-Nov-13 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.