Upgrading app from 2003 to 2005

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am VERY new to .Net and C#. But I have an app that I bought from a vendor
with the source. This was written in C#2003. I have VS2005. I went through
the upgrade process.. I have a problem, I am not sure what it is or what to
do. But I think it has something to do with a dialog box. The app had a
toolbar with buttons on it, on some of the button a dialog box is suppose to
popup and give the user a selection of items to view. The error I am getting
with e.Message is
"Cannot evaluate expression because a native frame is on top of the call
stack." Can anyone tell me why I am getting this and I can fix it. Also, if
anyone else has seen problems with going from 2003 to 2005, I would love to
hear about them.
Thanks,
Brian
 
Brian,

Without seeing the code, it is nearly impossible to tell.

I don't suppose there is a way that you can post the code, or the
section that is causing the problem, is there?
 
I am trying to find that now, I get to the section where the error message
is displayed, but trying to figured who called this bit of code.

Nicholas Paldino said:
Brian,

Without seeing the code, it is nearly impossible to tell.

I don't suppose there is a way that you can post the code, or the
section that is causing the problem, is there?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brian Shafer said:
Hello,
I am VERY new to .Net and C#. But I have an app that I bought from a
vendor
with the source. This was written in C#2003. I have VS2005. I went
through
the upgrade process.. I have a problem, I am not sure what it is or what
to
do. But I think it has something to do with a dialog box. The app had a
toolbar with buttons on it, on some of the button a dialog box is suppose
to
popup and give the user a selection of items to view. The error I am
getting
with e.Message is
"Cannot evaluate expression because a native frame is on top of the call
stack." Can anyone tell me why I am getting this and I can fix it. Also,
if
anyone else has seen problems with going from 2003 to 2005, I would love
to
hear about them.
Thanks,
Brian
 
private Form Thresholds_Click()
{

string []ListboxItems;

if (GloData.Appconfig.IS_AVESTASW())
ListboxItems= new string []
{TM("CHOCKS").ToUpper(),TM("BEARINGS").ToUpper()};
else
ListboxItems= new string []
{TM("CHOCKS").ToUpper(),TM("BEARINGS").ToUpper(),TM("ROLLS
STANDS").ToUpper()};
Color []ColorsItems={Color.White,Color.Red,Color.Yellow};
FrmItems frm= new
FrmItems(this.toolBarThrsh.Rectangle,ListboxItems,ColorsItems);
Form NewForm=null;
if (frm.ShowDialog() == DialogResult.OK)
{
NewForm= new FrmThresholds(this,frm.selectedIndex);
ActiveMdichild.Close();
ActiveMdichild=null;
}
return NewForm;

}

Nicholas Paldino said:
Brian,

Without seeing the code, it is nearly impossible to tell.

I don't suppose there is a way that you can post the code, or the
section that is causing the problem, is there?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brian Shafer said:
Hello,
I am VERY new to .Net and C#. But I have an app that I bought from a
vendor
with the source. This was written in C#2003. I have VS2005. I went
through
the upgrade process.. I have a problem, I am not sure what it is or what
to
do. But I think it has something to do with a dialog box. The app had a
toolbar with buttons on it, on some of the button a dialog box is suppose
to
popup and give the user a selection of items to view. The error I am
getting
with e.Message is
"Cannot evaluate expression because a native frame is on top of the call
stack." Can anyone tell me why I am getting this and I can fix it. Also,
if
anyone else has seen problems with going from 2003 to 2005, I would love
to
hear about them.
Thanks,
Brian
 
Brian,

Ok, knowing which line the error occurs on would help as well...


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brian Shafer said:
private Form Thresholds_Click()
{

string []ListboxItems;

if (GloData.Appconfig.IS_AVESTASW())
ListboxItems= new string []
{TM("CHOCKS").ToUpper(),TM("BEARINGS").ToUpper()};
else
ListboxItems= new string []
{TM("CHOCKS").ToUpper(),TM("BEARINGS").ToUpper(),TM("ROLLS
STANDS").ToUpper()};
Color []ColorsItems={Color.White,Color.Red,Color.Yellow};
FrmItems frm= new
FrmItems(this.toolBarThrsh.Rectangle,ListboxItems,ColorsItems);
Form NewForm=null;
if (frm.ShowDialog() == DialogResult.OK)
{
NewForm= new FrmThresholds(this,frm.selectedIndex);
ActiveMdichild.Close();
ActiveMdichild=null;
}
return NewForm;

}

Nicholas Paldino said:
Brian,

Without seeing the code, it is nearly impossible to tell.

I don't suppose there is a way that you can post the code, or the
section that is causing the problem, is there?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brian Shafer said:
Hello,
I am VERY new to .Net and C#. But I have an app that I bought from a
vendor
with the source. This was written in C#2003. I have VS2005. I went
through
the upgrade process.. I have a problem, I am not sure what it is or
what
to
do. But I think it has something to do with a dialog box. The app had
a
toolbar with buttons on it, on some of the button a dialog box is
suppose
to
popup and give the user a selection of items to view. The error I am
getting
with e.Message is
"Cannot evaluate expression because a native frame is on top of the
call
stack." Can anyone tell me why I am getting this and I can fix it.
Also,
if
anyone else has seen problems with going from 2003 to 2005, I would
love
to
hear about them.
Thanks,
Brian
 
LOL.. sorry about that.. thats what happens when I get in a hurry....
if (frm.ShowDialog() == DialogResult.OK)

the message here is
"A first chance exception of type 'System.ObjectDisposedException' occurred
in System.Windows.Forms.dll" this is printed to the immediate window

then it goes to
public void Application_ThreadException(object sender,
System.Threading.ThreadExceptionEventArgs t)
{
DialogResult result = DialogResult.Cancel;

try
{
result = ShowThreadExceptionDialog(t.Exception);
}
catch
{

try
{
MessageBox.Show("Fatal Error", "Fatal Error",
MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop);
}
finally
{
Application.Exit();
}
}

// Exits the program when the user clicks Abort.
if (result == DialogResult.Abort)
Application.Exit();
}

// Creates the error message and displays it.
private DialogResult ShowThreadExceptionDialog(Exception e)
{
string errorMsg = "An error has occurred: ";
errorMsg = errorMsg + e.Message;// + "\n\nStack Trace:\n" + e.StackTrace;
if (frm!=null)
{
string err=errorMsg + "\rStack Trace:\r\n" + e.StackTrace;
frm.WriteErrorOnFile(err,System.Drawing.Color.Red);
}
LastError=errorMsg;
return MessageBox.Show(errorMsg, "Application Error",
MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop);
}


Nicholas Paldino said:
Brian,

Ok, knowing which line the error occurs on would help as well...


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brian Shafer said:
private Form Thresholds_Click()
{

string []ListboxItems;

if (GloData.Appconfig.IS_AVESTASW())
ListboxItems= new string []
{TM("CHOCKS").ToUpper(),TM("BEARINGS").ToUpper()};
else
ListboxItems= new string []
{TM("CHOCKS").ToUpper(),TM("BEARINGS").ToUpper(),TM("ROLLS
STANDS").ToUpper()};
Color []ColorsItems={Color.White,Color.Red,Color.Yellow};
FrmItems frm= new
FrmItems(this.toolBarThrsh.Rectangle,ListboxItems,ColorsItems);
Form NewForm=null;
if (frm.ShowDialog() == DialogResult.OK)
{
NewForm= new FrmThresholds(this,frm.selectedIndex);
ActiveMdichild.Close();
ActiveMdichild=null;
}
return NewForm;

}

Nicholas Paldino said:
Brian,

Without seeing the code, it is nearly impossible to tell.

I don't suppose there is a way that you can post the code, or the
section that is causing the problem, is there?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hello,
I am VERY new to .Net and C#. But I have an app that I bought from a
vendor
with the source. This was written in C#2003. I have VS2005. I went
through
the upgrade process.. I have a problem, I am not sure what it is or
what
to
do. But I think it has something to do with a dialog box. The app had
a
toolbar with buttons on it, on some of the button a dialog box is
suppose
to
popup and give the user a selection of items to view. The error I am
getting
with e.Message is
"Cannot evaluate expression because a native frame is on top of the
call
stack." Can anyone tell me why I am getting this and I can fix it.
Also,
if
anyone else has seen problems with going from 2003 to 2005, I would
love
to
hear about them.
Thanks,
Brian
 
Brian,

I think that the error is occuring within the form itself, and not the
line of code that you are actually showing. You have to dig into the form,
and see what the exception is in there. Just calling ShowDialog shouldn't
throw an exception, unless you are doing something in the dialog.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brian Shafer said:
LOL.. sorry about that.. thats what happens when I get in a hurry....
if (frm.ShowDialog() == DialogResult.OK)

the message here is
"A first chance exception of type 'System.ObjectDisposedException'
occurred
in System.Windows.Forms.dll" this is printed to the immediate window

then it goes to
public void Application_ThreadException(object sender,
System.Threading.ThreadExceptionEventArgs t)
{
DialogResult result = DialogResult.Cancel;

try
{
result = ShowThreadExceptionDialog(t.Exception);
}
catch
{

try
{
MessageBox.Show("Fatal Error", "Fatal Error",
MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop);
}
finally
{
Application.Exit();
}
}

// Exits the program when the user clicks Abort.
if (result == DialogResult.Abort)
Application.Exit();
}

// Creates the error message and displays it.
private DialogResult ShowThreadExceptionDialog(Exception e)
{
string errorMsg = "An error has occurred: ";
errorMsg = errorMsg + e.Message;// + "\n\nStack Trace:\n" + e.StackTrace;
if (frm!=null)
{
string err=errorMsg + "\rStack Trace:\r\n" + e.StackTrace;
frm.WriteErrorOnFile(err,System.Drawing.Color.Red);
}
LastError=errorMsg;
return MessageBox.Show(errorMsg, "Application Error",
MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Stop);
}


Nicholas Paldino said:
Brian,

Ok, knowing which line the error occurs on would help as well...


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Brian Shafer said:
private Form Thresholds_Click()
{

string []ListboxItems;

if (GloData.Appconfig.IS_AVESTASW())
ListboxItems= new string []
{TM("CHOCKS").ToUpper(),TM("BEARINGS").ToUpper()};
else
ListboxItems= new string []
{TM("CHOCKS").ToUpper(),TM("BEARINGS").ToUpper(),TM("ROLLS
STANDS").ToUpper()};
Color []ColorsItems={Color.White,Color.Red,Color.Yellow};
FrmItems frm= new
FrmItems(this.toolBarThrsh.Rectangle,ListboxItems,ColorsItems);
Form NewForm=null;
if (frm.ShowDialog() == DialogResult.OK)
{
NewForm= new FrmThresholds(this,frm.selectedIndex);
ActiveMdichild.Close();
ActiveMdichild=null;
}
return NewForm;

}

:

Brian,

Without seeing the code, it is nearly impossible to tell.

I don't suppose there is a way that you can post the code, or the
section that is causing the problem, is there?


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

message
Hello,
I am VERY new to .Net and C#. But I have an app that I bought from
a
vendor
with the source. This was written in C#2003. I have VS2005. I
went
through
the upgrade process.. I have a problem, I am not sure what it is or
what
to
do. But I think it has something to do with a dialog box. The app
had
a
toolbar with buttons on it, on some of the button a dialog box is
suppose
to
popup and give the user a selection of items to view. The error I am
getting
with e.Message is
"Cannot evaluate expression because a native frame is on top of the
call
stack." Can anyone tell me why I am getting this and I can fix it.
Also,
if
anyone else has seen problems with going from 2003 to 2005, I would
love
to
hear about them.
Thanks,
Brian
 
Back
Top