[.net] Registering Winsock control
Hi,
I was wondering if someone could tell me how to register the winsock control in vb.net? I have this code I'd like to run, but I can't because I haven't registered the control yet.
Please help.
It would probably be better to replace the Winsock code with code that uses System.Net.Sockets instead (not especially helpful, I know). Failing that -- install VB6?
Well I tried using System.net.sockets but I keep getting this cross threading error whenever I try to write the text to my chat window/textbox.
Is there anyways around this???
[Edited by - ed209 on July 15, 2008 1:12:55 AM]
Cross-thread operation not valid: Control 'txtChat' accessed from a thread other than the thread it was created on.
Is there anyways around this???
[Edited by - ed209 on July 15, 2008 1:12:55 AM]
Quote:Original post by ed209
Is there anyways around this???
How to: Make Thread-Safe Calls to Windows Forms Controls
Quote:Original post by ed209As the article states:
Hope it doesn't cause any problems.
Quote:Access to Windows Forms controls is not inherently thread safe. If you have two or more threads manipulating the state of a control, it is possible to force the control into an inconsistent state. Other thread-related bugs are possible as well, including race conditions and deadlocks. It is important to ensure that access to your controls is done in a thread-safe way..NET helps you out here by throwing an exception as soon as you try and access a control from a different thread to the one it was created on - consistent, avoidable failure (even if nothing appears to be wrong) is better than erratic and difficult-to-replicate bugs. You should write thread-safe code rather than rely on the workaround.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement