Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 00:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Alternative zu CheckForIllegalCrossThreadCalls

Discussion on Alternative zu CheckForIllegalCrossThreadCalls within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1


 
Requi's Avatar
 
elite*gold: 3800
The Black Market: 244/0/0
Join Date: Dec 2012
Posts: 13,039
Received Thanks: 8,243
Alternative zu CheckForIllegalCrossThreadCalls

Bin ja nicht gerade der beste was .net angeht

Habt ihr eine alternative?
Google konnte da nix gutes ausspucken.

MfG
Requi is offline  
Old 06/27/2013, 22:38   #2
 
elite*gold: 100
Join Date: Aug 2005
Posts: 595
Received Thanks: 208
Bisschen wenig Infos was genau du wissen magst

Denk mal das hier ?

dready is offline  
Old 06/27/2013, 22:59   #3
 
'Aleo's Avatar
 
elite*gold: 175
Join Date: Jun 2013
Posts: 157
Received Thanks: 44
Ob es eine echte Alternative weiß ich jetzt nicht, aber wenn du willst kannst du dir gerne Delegates/Invokes anschauen. Einfach mal googeln.
'Aleo is offline  
Old 06/27/2013, 23:10   #4
 
elite*gold: 100
Join Date: Aug 2005
Posts: 595
Received Thanks: 208
@Aleo wenn ichs rechtig im Kopf hab ist eines der Beispiele im Msdn genau das

Für Guigedönse benutz ich gern diesen Oneliner

Code:
 void Bla()
    {
        if (InvokeRequired) { Invoke(new Action(bla)); return; }
//nix
    }
dready is offline  
Thanks
1 User
Old 06/28/2013, 09:27   #5
 
»Barney«'s Avatar
 
elite*gold: 0
Join Date: May 2012
Posts: 868
Received Thanks: 947
Code:
if (this.InvokeRequired)
     this.Invoke(new MethodInvoker(() => this.textBox1.Text = "Thread Safe"));
else
     this.textBox1.Text = "Already on the UI thread";
I hope this is what you asked
»Barney« is offline  
Old 06/28/2013, 12:32   #6


 
Cholik's Avatar
 
elite*gold: 4
Join Date: Aug 2008
Posts: 6,786
Received Thanks: 4,992
Cholik is offline  
Old 07/01/2013, 05:00   #7
 
»jD«'s Avatar
 
elite*gold: 237
Join Date: Sep 2010
Posts: 1,152
Received Thanks: 4,910
dready and chichi are correct. If the control isn't owned by the thread the function is called on, you will need to invoke it.

-jD
»jD« is offline  
Old 07/01/2013, 10:35   #8


 
Cholik's Avatar
 
elite*gold: 4
Join Date: Aug 2008
Posts: 6,786
Received Thanks: 4,992
You don't have to invoke when using the Backgroundworker Class... why should you choose that class if you're going to invoke anyway?

Just read my link... When using Backgroundworker you can use the ReportProgress Event which is executed in the context of the UI thread, so you don't have to invoke anything.


Und nochmal auf deutsch:
Wenn man den Backgroundworker nutzt braucht man nicht zu invoken, wie ich schon 4 Mal geschrieben habe, aber keiner scheints zu lesen. Das ist ja das tolle am Backgroundworker, man muss nix mehr invoken. Einfach die Events der Klasse nutzen (z.B. ReportProgress) welche im Kontext des UI-Threads ausgeführt werden. Wenn man so oder so invoken WILL braucht man auch nicht die Backgroundworker Klasse nutzen.



Cholik is offline  
Old 07/01/2013, 11:34   #9
 
elite*gold: 100
Join Date: Aug 2005
Posts: 595
Received Thanks: 208
Ofcourse you dont have to invoke if you use a Backgroundworker, but Requi mentioned in the last thread that he dont like Background workers so i guessed he wished to know an Invoke example.

The Msdn Example about threadsave working with the GUI has an example about using a Backgroundworker too.
dready is offline  
Thanks
1 User
Old 07/01/2013, 14:56   #10
 
»jD«'s Avatar
 
elite*gold: 237
Join Date: Sep 2010
Posts: 1,152
Received Thanks: 4,910
Background workers are being deprecated in preference of the TPL, ThreadPool, and async/await anyway.

-jD
»jD« is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Alternative zu ad.fly etc. ??
05/02/2013 - Off Topic - 6 Replies
Hallo :) Ich bin dabei ein Forum zu eröffnen und möchte mir mit solchen Diensten wie ad.fly etwas Geld verdienen. Ich suche aber nach einem Dienst wo man nicht nochmal auf "skip add" wie bei ad.fly klicken muss da ich dies nervig finde. Kennt ihr so einen Dienst ? Nur ein Klick nicht zwei ^^ Ist mit Absicht falsch geschrieben da epvp es sonst zensiert ;)
Alternative zu GW2?
04/22/2013 - Guild Wars 2 - 7 Replies
Hallo, ich habe demletzt meinen GW2 Account verkauft da mich das Spiel einfach nicht wirklich gefesselt hat (war Level 53). Nun suche ich eine Alternative die ähnlich wie GW2 im Bereich Grafik und Gameplay ist. Wenn möglich, ein F2P Modell wo man auch ohne bzw. nur mit wenig Einsatz von echtem Geld viel Spaß haben kann :) Wenn dass das falsche Forum ist, bitte ich einen Moderator diesen Thread zu verschieben. Gruß
Alternative zu CF Eu
04/29/2012 - CrossFire - 5 Replies
Hallo zusammen, Mein CF EU Acc wurde vor einigen Monaten gesperrt. (Warum auch immer, bin noch immer wütend auf SGI :rtfm: ) Nun...ich hab ne fixe IP und nen IP ban. Ich kann mich weder auf die SGI Seite einloggen, noch einen neuen Acc erstellen (selbst mit verschiedenen Proxys gings nicht) Doch nun hab ich mal wieder richtig Bock darauf und kann nicht spielen. Deshalb suche ich jetzt so ein ähnliches Spiel. Meine Anforderungen dafür sind nicht wirklich hoch: - CS Feeling - Grafik nicht...
Dev C++ Alternative für Mac OS X
02/17/2012 - C/C++ - 2 Replies
Hey Leute, ich lerne momentan C, als meine erste Hochsprache. Unter Windows, also auf meinem Netbook und an den Schulcomputern benutzen wir den Bloodshed Dev C++ Compiler, den ich vorallem aufgrund des eingebauten Editors und der einfachen Handhabung sehr gut finde. Jetzt meine Frage, gibt es eine gute Alternative, die auf meinem Macbook laufen würde? GCC kenne ich und habe ich schon 1-2 mal benutzt. Da er allerdings komplett ohne GUI läuft, suche ich nach einer Alternative die dem Dev...
My Alternative way to Bot
05/25/2007 - Silkroad Online - 6 Replies
Errr. Someway i use this things to bot.. 1st Download this nubot Helper ( This makes Your Skills Usable ) http://www.elitepvpers.com/forum/index.php?...nubo t+helper&s= 2nd Download The HaxCr4x 3.1 ( This makes your Srobot Autotrain ) this works on the last softmod version. DONT FORGET TO DELETE THE SM.DLL on Your SRO Folder.. http://projecthax.com/download/HaxCr4x3.1.rar



All times are GMT +2. The time now is 00:31.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.