Problems with nSidePolygon - VB Express 2008

Valued Contributor
Valued Contributor

 

Hi,

I have some experience in programming with VB6 but absolitely new to VB.NET.

As first attempt, I am trying the sample application nSidePolygon.

1. I open the nSidePolygon.vbproj in VB Express 2008 on WinXP.

2. I open SE20, a new part document and start the sketch command and select a workplane.

A. I try to step through the code.

When I click into the document after completing the form, I get the following error:

Error # 5 was generated by System.Windows.Form

( Cross thread operation not valid: control 'labStatus' accessed from a thread other than the thread it was created on. )

and the program hangs.

B. I run the code ('F5') from within the IDE, but I get the error message "Solid Edge must be running before you start this macro" eventhough it is already open.

What am I missing?

 

Posted by: Narantar Vidyarthee
Post date: 5/16/2010 8:08:07 PM

3 REPLIES

RE: Problems with nSidePolygon - VB Express 2008

Valued Contributor
Valued Contributor

 

Hi,

with Solid Edge ST2 you find an updated version of the program nSidePolygon for .NET

 

 

Posted by: Wolfgang Kunert
Post date: 5/18/2010 11:26:59 PM

RE: Problems with nSidePolygon - VB Express 2008

Valued Contributor
Valued Contributor

Wolfgang,

 

Thanks for informing. I'll try that.

 

But what is the problem with V20 code. I just want to understand.

 

Posted by: Narantar Vidyarthee
Post date: 5/19/2010 12:33:59 AM

RE: Problems with nSidePolygon - VB Express 2008

Valued Contributor
Valued Contributor

 

Nirantar,

Error:

Cross-thread operation not valid: Control 'ControlName' accessed from a thread other than the thread it was created on.

You find a description and solution i.e. here: http://www.developersource.net/ErrorPage.aspx?ID=5

Another solution could be to use the BackgroundWorker component. In the ReportProgress event handler method you are able to update controls of the form.

 

 

Posted by: Wolfgang Kunert
Post date: 5/19/2010 1:57:27 AM