Click here to Skip to main content
15,897,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: code to analyze bitmap then create predefined palette of colors in bitmap? Pin
Richard Perrine24-Jan-09 5:14
Richard Perrine24-Jan-09 5:14 
AnswerRe: code to analyze bitmap then create predefined palette of colors in bitmap? Pin
Randor 24-Jan-09 6:59
professional Randor 24-Jan-09 6:59 
Questionexplorer in Windows CE Pin
Miss_F24-Jan-09 2:18
Miss_F24-Jan-09 2:18 
AnswerRe: explorer in Windows CE Pin
Stuart Dootson24-Jan-09 3:09
professionalStuart Dootson24-Jan-09 3:09 
GeneralRe: explorer in Windows CE Pin
Miss_F24-Jan-09 3:15
Miss_F24-Jan-09 3:15 
GeneralRe: explorer in Windows CE Pin
Stuart Dootson24-Jan-09 4:43
professionalStuart Dootson24-Jan-09 4:43 
GeneralRe: explorer in Windows CE Pin
Miss_F24-Jan-09 18:53
Miss_F24-Jan-09 18:53 
QuestionGet TrackBar Value in Form from a Thread Pin
Member 391913824-Jan-09 1:16
Member 391913824-Jan-09 1:16 
A trackBar->Value in a form has to be read out from a thread. I read so many articles, but still I got a problem.

I use a delegate which should return me the value of the trackBar position:
delegate int DelegateTrackBarCallBack(System::Object ^object);

I started the Thread by a ParametriziedThreadStart after a Button-Click

Thread^ oThread = gcnew Thread(gcnew ParameterizedThreadStart(&ProcessCANMessage::CAN_Thread::CANThread));

In CANThread I do
target_velocity=Get_TrackBar1_Value(object);

with
int ProcessCANMessage::CAN_Thread::Get_TrackBar1_Value(System::Object^ object)
{
   CAN_Anbindung::Form1^ form;
   form = (CAN_Anbindung::Form1^)object;
   int trackBar_Value;
   if (form->trackBar1->InvokeRequired==false)
   {
	   trackBar_Value=form->trackBar1->Value;
   }
   else
   {
	   CAN_Anbindung::Form1::DelegateTrackBarCallBack ^d = gcnew CAN_Anbindung::Form1::DelegateTrackBarCallBack(Get_TrackBar1_Value);
	   form->Invoke(d, gcnew array<system::object^>{form});
   }
   return (trackBar_Value);
}


During debugging the correct value is assigned to trackBar_Value. But when leaving Get_TrackBar1_Value trackBar_Value is set to "0".

Any ideas what to do?


AnswerRe: Get TrackBar Value in Form from a Thread Pin
Stuart Dootson24-Jan-09 1:37
professionalStuart Dootson24-Jan-09 1:37 
GeneralRe: Get TrackBar Value in Form from a Thread Pin
Member 391913824-Jan-09 1:56
Member 391913824-Jan-09 1:56 
GeneralRe: Get TrackBar Value in Form from a Thread Pin
Stuart Dootson24-Jan-09 2:19
professionalStuart Dootson24-Jan-09 2:19 
GeneralRe: Get TrackBar Value in Form from a Thread Pin
Chris.G.Weber24-Jan-09 6:40
Chris.G.Weber24-Jan-09 6:40 
GeneralRe: Get TrackBar Value in Form from a Thread Pin
Member 391913824-Jan-09 8:12
Member 391913824-Jan-09 8:12 
QuestionHelp for Wizard look ! Pin
Le@rner24-Jan-09 0:50
Le@rner24-Jan-09 0:50 
AnswerRe: Help for Wizard look ! Pin
Naveen24-Jan-09 1:04
Naveen24-Jan-09 1:04 
GeneralRe: Help for Wizard look ! Pin
Le@rner24-Jan-09 1:51
Le@rner24-Jan-09 1:51 
Question[Message Deleted] Pin
AnithaSubramani24-Jan-09 0:41
AnithaSubramani24-Jan-09 0:41 
AnswerRe: Listener in MFC Pin
Naveen24-Jan-09 1:01
Naveen24-Jan-09 1:01 
QuestionRe: Listener in MFC Pin
Rajesh R Subramanian25-Jan-09 4:47
professionalRajesh R Subramanian25-Jan-09 4:47 
AnswerRe: Listener in MFC Pin
Hans Dietrich25-Jan-09 9:04
mentorHans Dietrich25-Jan-09 9:04 
QuestionDebuggerEvents under C++ in Visual Studio [modified] Pin
primexx23-Jan-09 22:31
primexx23-Jan-09 22:31 
QuestionSetLayeredWindowAttributes() - Undeclared identifier Pin
ganesh.dp23-Jan-09 22:06
ganesh.dp23-Jan-09 22:06 
AnswerRe: SetLayeredWindowAttributes() - Undeclared identifier Pin
Naveen23-Jan-09 22:39
Naveen23-Jan-09 22:39 
GeneralRe: SetLayeredWindowAttributes() - Undeclared identifier Pin
ganesh.dp23-Jan-09 22:56
ganesh.dp23-Jan-09 22:56 
GeneralRe: SetLayeredWindowAttributes() - Undeclared identifier Pin
ganesh.dp23-Jan-09 23:00
ganesh.dp23-Jan-09 23:00 

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.