-
Marshall Important ?
Is it necessary to marshall whenever we want to set a properties of a controls
from another thread? I have background thread and it perform a job to set
a label1.text (label created on main thread). This job is so simple, so I
don't marshalled the call, and the program run just fine. Is it safe if I
ignore marshall? Or is there any side effect if do this?
-
Re: Marshall Important ?
You should not need to marshal if all your work is done within the same
AppDomain. The only time that you should need to marshal is been AppDomains
or to a COM object.
However... if you mean to ask if you need to Invoke to call a form element
from a different thread, then yes, you do. Only if you get luckily will a
control work correctly if called from another thread. Controls are NOT
thread safe.
HTH
David
"Jahya" <jahya@yahoo.com> wrote in message news:3d774ef9$1@10.1.10.29...
>
> Is it necessary to marshall whenever we want to set a properties of a
controls
> from another thread? I have background thread and it perform a job to set
> a label1.text (label created on main thread). This job is so simple, so I
> don't marshalled the call, and the program run just fine. Is it safe if I
> ignore marshall? Or is there any side effect if do this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks