Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Tutorials > CSharp Tutorials

CSharp Tutorials Tutorials for C#

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 05-16-2008, 12:12 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,589
Last Blog:
Web slideshow in JavaS...
Rep Power: 76
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

That is an error - it's a runtime exception. It occurs when you try to use a control that is currently being used by another thread (the one on which it was created).

Multiple threads are being used in this program. Jordan, have you made sure you're not using controls from another thread?
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 05-16-2008, 11:49 PM
Martin_kp's Avatar   
Martin_kp Martin_kp is offline
Learning Programmer
 
Join Date: May 2008
Location: Indonesia
Age: 10
Posts: 47
Rep Power: 2
Martin_kp is on a distinguished road
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

Quote:
Originally Posted by Xav View Post
That is an error - it's a runtime exception. It occurs when you try to use a control that is currently being used by another thread (the one on which it was created).

Multiple threads are being used in this program. Jordan, have you made sure you're not using controls from another thread?
Hey Xav, thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 05-17-2008, 12:08 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,589
Last Blog:
Web slideshow in JavaS...
Rep Power: 76
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

So it's working now? What did you change?
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 06-06-2008, 11:56 AM
thame thame is offline
Newbie
 
Join Date: Jun 2008
Posts: 1
Rep Power: 0
thame is on a distinguished road
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

First, I have the same problem as the previous poster not when I compile the program but when I run it (press the 'get ip address' button):

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

The debugger does come up with these two:

Warning 1 'System.Net.Dns.BeginResolve(string, System.AsyncCallback, object)' is obsolete: 'BeginResolve is obsoleted for this type, please use BeginGetHostEntry instead. Search Microsoft.com Framework Developer Center' C:\Documents and Settings\User\Local Settings\Application Data\Temporary Projects\WindowsFormsApplication1\Program.cs 84 9 WindowsFormsApplication1

Warning 2 'System.Net.Dns.EndResolve(System.IAsyncResult)' is obsolete: 'EndResolve is obsoleted for this type, please use EndGetHostEntry instead. Search Microsoft.com Framework Developer Center' C:\Documents and Settings\User\Local Settings\Application Data\Temporary Projects\WindowsFormsApplication1\Program.cs 93 28 WindowsFormsApplication1


I don't understand how to fix it.

Now, I have a bunch of questions! Thank you for the time you put toward answering them, I intend to go over every single one of your tutorials. Thank you for them.

1. Why is AsyncCallback private when you define it as a class?
2. What does it do and where does OnResolved come from/mean?
3. What does "new" indicate? Even if we're defining a new variable (label1, label2, etc) we need to say that it's a 'new' version of a certain function?
4. What is Label only said once? Aren't there three labels? Don't you need to do everything else three times?
5. I think I understand generally what this means, but can you explain each piece of it?

void ButtonResolveOnClick(object obj, EventArgs ea)

6. In the following lines,

results.Items.Clear();
string addr = address.Text;
Object state = new Object();

Dns.BeginResolve(addr, OnResolved, state);

are address.text and Object functions of results.Items.Clear and is Dns.BeginResolve a function of Object? I think I follow it, even if I don't know why string addr is required. Does it refer to 'address' which was defined previously?

"We use the keyword "string" to group the data in lines." So this is the make it pop out a new line each time it returns data?

7. If this is the case, where are we listing the buffer? I think I understand the function of it, but can you explain what the buffer section is doing?



Thank you a ton. I only know mathematica and matlab, so this is my first real attempt at a real programming language. Sorry I'm a novice.

Thanks for your time.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 08-04-2008, 01:27 PM
giuliel's Avatar   
giuliel giuliel is offline
Learning Programmer
 
Join Date: Aug 2008
Location: Montreal, Canada
Age: 25
Posts: 60
Rep Power: 2
giuliel is on a distinguished road
Send a message via MSN to giuliel
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

very well said. now if only i had found this when i was just starting C#... lol
__________________
If at first you don't succeed, skydiving is not for you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #16 (permalink)  
Old 08-07-2008, 01:47 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,589
Last Blog:
Web slideshow in JavaS...
Rep Power: 76
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

Uh oh - Jordan, I thınk you've fallen ınto the cross-threadıng trap wıth your tutorıal!
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 08-07-2008, 02:06 PM
gaylo565's Avatar   
gaylo565 gaylo565 is offline
Programmer
 
Join Date: May 2007
Location: flagstaff, az
Posts: 187
Last Blog:
String Manipulation wi...
Rep Power: 9
gaylo565 is a jewel in the roughgaylo565 is a jewel in the roughgaylo565 is a jewel in the rough
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

I don't know how you are getting this error as there is only one main thread in the program. The resolver worked well for me and I was not able to get any run time or design time errors? I tried several different web addresses and it worked beautifully. This was a little while back but I can't imagine what the problem with it would be now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 08-07-2008, 02:13 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,589
Last Blog:
Web slideshow in JavaS...
Rep Power: 76
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

I know, ıt's odd. I haven't trıed ıt yet, no .NET on the current computer. But perhaps ıt ıs a versıon problem, or somethıng?
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 08-07-2008, 02:28 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 9,224
Last Blog:
Ext JS or Ext GWT
Rep Power: 20
Jordan is just really niceJordan is just really niceJordan is just really niceJordan is just really nice
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

Could be, maybe they are using it with 2005 or Visual Studio 2008? I've seen minor errors like this occur between Studio 2008 and 2008 Express Editions...
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
The CodeCall Wiki is now fully integrated with vBulletin users! Check it out and add some new pages!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 08-08-2008, 01:48 PM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,589
Last Blog:
Web slideshow in JavaS...
Rep Power: 76
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Tutorial: Starting C# with C# 2008 Express Edition

That sounds weırd. You'd thınk the full versıon would allow more control over threads, not less...
__________________


Mr. Xav | Website | Forums | Blog
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply

Tags
c# tutorial, express edition



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio 2008: C# Hello World Tutorial Jordan CSharp Tutorials 14 11-20-2008 02:53 PM
Tutorial: Visual Studio 2008 Obfuscating with Dotfuscator Jordan Tutorials 5 11-16-2008 03:05 PM
Inkpad Tutorial - Visual C# 2008 Express Rammer124 CSharp Tutorials 5 02-18-2008 10:15 PM
Visual Studio 2005 Express Edition Crane Software Development Tools 9 05-25-2006 07:17 PM


All times are GMT -5. The time now is 12:48 PM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 98%

Ads