Click here to Skip to main content
15,919,749 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Thread and listView Pin
Luc Pattyn27-Jul-07 13:43
sitebuilderLuc Pattyn27-Jul-07 13:43 
GeneralRe: Thread and listView Pin
Mark Salsbery27-Jul-07 14:03
Mark Salsbery27-Jul-07 14:03 
GeneralRe: Thread and listView Pin
Luc Pattyn27-Jul-07 14:06
sitebuilderLuc Pattyn27-Jul-07 14:06 
QuestionRe: Thread and listView Pin
abbd27-Jul-07 23:33
abbd27-Jul-07 23:33 
AnswerRe: Thread and listView Pin
Luc Pattyn27-Jul-07 23:49
sitebuilderLuc Pattyn27-Jul-07 23:49 
QuestionRe: Thread and listView Pin
abbd28-Jul-07 0:04
abbd28-Jul-07 0:04 
AnswerRe: Thread and listView Pin
Luc Pattyn28-Jul-07 0:21
sitebuilderLuc Pattyn28-Jul-07 0:21 
GeneralRe: Thread and listView Pin
abbd28-Jul-07 0:48
abbd28-Jul-07 0:48 
hello,

In 1st, i used a Timer, who get a packets every tick, but my application became heavy, for this reason i would use a Thread.

With Timer:

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {<br />
 timer5->Interval=10;<br />
 timer5->Start();<br />
}<br />
 <br />
private: System::Void timer5_Tick(System::Object^  sender, System::EventArgs^  e) {<br />
 <br />
While (there are packets which arrive ) {<br />
 <br />
listView->Items->add (one paquets)<br />
 <br />
}





Witht Thread { an exception on listView }
delegate void DelegateThreadTask();<br />
DelegateThreadTask ^ er;<br />
<br />
<br />
<br />
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {<br />
	Threading::Thread(gcnew ThreadStart(this, &Form1::Traitement));<br />
             t->Start();<br />
			<br />
		 }<br />
.<br />
.<br />
.<br />
 <br />
void Traitement( )<br />
{   while(true)<br />
	{ThreadTask();<br />
              Thread::Sleep(100);		<br />
	}<br />
		<br />
	}<br />
.<br />
.<br />
.<br />
void ThreadTask()		<br />
{<br />
 <br />
While (there are packets which arrive ) {<br />
 <br />
listView->Items->add (one packets)<br />
 <br />
}<br />
 <br />
er = gcnew DelegateThreadTask(this, &Form1::ThreadTask);<br />
er->Invoke();		}<br />
 <br />
<br />
<br />



Please hlep me,to get packets without heavy my système

Thank you verry mutch
GeneralRe: Thread and listView Pin
Luc Pattyn28-Jul-07 1:03
sitebuilderLuc Pattyn28-Jul-07 1:03 
QuestionRe: Thread and listView Pin
abbd28-Jul-07 2:39
abbd28-Jul-07 2:39 
AnswerRe: Thread and listView Pin
Luc Pattyn28-Jul-07 3:07
sitebuilderLuc Pattyn28-Jul-07 3:07 
QuestionRe: Thread and listView Pin
abbd28-Jul-07 11:20
abbd28-Jul-07 11:20 
QuestionVersion Info in C++/CLI assemblies Pin
Bartosz Bien27-Jul-07 11:07
Bartosz Bien27-Jul-07 11:07 
GeneralRe: Version Info in C++/CLI assemblies Pin
screanjap27-Apr-08 7:41
screanjap27-Apr-08 7:41 
QuestionWhy does Font class need full qualification? Pin
BuckBrown27-Jul-07 10:28
BuckBrown27-Jul-07 10:28 
AnswerRe: Why does Font class need full qualification? Pin
Bartosz Bien27-Jul-07 10:51
Bartosz Bien27-Jul-07 10:51 
AnswerRe: Why does Font class need full qualification? Pin
Mark Salsbery27-Jul-07 12:44
Mark Salsbery27-Jul-07 12:44 
QuestionWhy do some classes need full qualification Pin
BuckBrown27-Jul-07 10:26
BuckBrown27-Jul-07 10:26 
QuestionOpenEx problem Pin
CodeMaster_0527-Jul-07 4:15
CodeMaster_0527-Jul-07 4:15 
AnswerRe: OpenEx problem Pin
Mark Salsbery27-Jul-07 7:14
Mark Salsbery27-Jul-07 7:14 
GeneralRe: OpenEx problem Pin
CodeMaster_0527-Jul-07 9:43
CodeMaster_0527-Jul-07 9:43 
GeneralRe: OpenEx problem Pin
Mark Salsbery27-Jul-07 9:49
Mark Salsbery27-Jul-07 9:49 
GeneralRe: OpenEx problem Pin
Mark Salsbery27-Jul-07 9:54
Mark Salsbery27-Jul-07 9:54 
GeneralRe: OpenEx problem Pin
CodeMaster_0527-Jul-07 10:03
CodeMaster_0527-Jul-07 10:03 
QuestionCreateProcess with write permission Pin
slasktrat26-Jul-07 10:25
slasktrat26-Jul-07 10:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.