471,350 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

Upgrading app from 2003 to 2005

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
Jan 12 '06 #1
6 1204
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]
- mv*@spam.guard.caspershouse.com

"Brian Shafer" <Br*********@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
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

Jan 12 '06 #2
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 [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Brian Shafer" <Br*********@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
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


Jan 12 '06 #3
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(),T M("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 [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Brian Shafer" <Br*********@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
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


Jan 12 '06 #4
Brian,

Ok, knowing which line the error occurs on would help as well...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Shafer" <Br*********@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
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(),T M("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 [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Brian Shafer" <Br*********@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
> 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


Jan 12 '06 #5
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 [.NET/C# MVP]" wrote:
Brian,

Ok, knowing which line the error occurs on would help as well...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Shafer" <Br*********@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
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(),T M("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 [.NET/C# MVP]" wrote:
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]
- mv*@spam.guard.caspershouse.com

"Brian Shafer" <Br*********@discussions.microsoft.com> wrote in message
news:77**********************************@microsof t.com...
> 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


Jan 12 '06 #6
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]
- mv*@spam.guard.caspershouse.com

"Brian Shafer" <Br*********@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
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 [.NET/C# MVP]" wrote:
Brian,

Ok, knowing which line the error occurs on would help as well...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian Shafer" <Br*********@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
> 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(),T M("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 [.NET/C# MVP]" wrote:
>
>> 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]
>> - mv*@spam.guard.caspershouse.com
>>
>> "Brian Shafer" <Br*********@discussions.microsoft.com> wrote in
>> message
>> news:77**********************************@microsof t.com...
>> > 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
>>
>>
>>


Jan 12 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Mike Owen | last post: by
13 posts views Thread by penguin732901 | last post: by
4 posts views Thread by Spurry Moses | last post: by
5 posts views Thread by Brian Shannon | last post: by
4 posts views Thread by Anil Gupte | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.