Click here to Skip to main content
15,867,867 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

The language that I'm using is C++.

I have a backgroundworker to prevent my UI from crashing.

However, within the background function I need to update my UI.

I read that using the control's Invoke will do the trick. However, I can't seem to make it work. The code is as follows:
C++
pictureBox2->Invoke((MethodInvoker^) delegate(){
pictureBox2->Image = btmp;
pictureBox2->Update();
});

C++
error C2065: 'delegate' : undeclared identifier	
error C2143: syntax error : missing ')' before '{'	
error C2143: syntax error : missing ';' before '{'	
error C2059: syntax error : ')'

Any ideas?

Thanks! Any help would be greatly appreciated!
Posted
Updated 15-Apr-12 5:07am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900