Marshall Important ?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Marshall Important ?

  1. #1
    Jahya Guest

    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?

  2. #2
    David Williams Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center