| | |
exception
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2008
Posts: 98
Reputation:
Solved Threads: 2
C++ Syntax (Toggle Plain Text)
private: delegate System::Void delegate_function(void); if(this->InvokeRequired) { AsyncCallback ^ac = gcnew AsyncCallback(&WCS::MainForm::delegate_function_callback); delegate_function ^df = gcnew delegate_function(this, &WCS::MainForm::function_to_invoke); System::IAsyncResult ^asyncresult; //Begin invoke command here. try { asyncresult = df->BeginInvoke(ac, df); //asyncresult = this->statusLight->BeginInvoke(ac, df); //this->commsStatusLight->EndInvoke(asyncresult); //df->Invoke(); df->EndInvoke(asyncresult); //df->DynamicInvoke(ac, df); } catch (...) { std::cerr << "caught"; } } public: System::Void function_to_invoke() { this->statusLight->BackColor = DataClass->getlight(); this->statusLight1->BackColor = DataClass->getight1(); this->butCheck->Enabled = DataClass->getenable(); this->status->Text = DataClass->getstatus(); //this line returns instead of finishing this->status1->Text = DataClass->getstatus1(); } private: static System::Void delegate_function_callback(System::IAsyncResult ^asyncresult) { //delegate_function ^df = gcnew delegate_function(&WCS::MainForm::function_to_invoke); //df->EndInvoke(asyncresult); }
I am at my wits end with this. The invoke works the first time through, but when all this gets called again, it doesnt get past the line marked above in function_to_invoke. It also throws an exception after the first time. First time works perfect, half works any time after. Please help if you know anything, any advice would be appreciated. Thanks.
Last edited by Nemoticchigga; May 28th, 2008 at 11:53 am.
![]() |
Similar Threads
- purpose of exception handling 'finally' clause (Java)
- help with sort using Calendar class getting null pointer exception (Java)
- fatal exception OE VXD VFAT (Windows 95 / 98 / Me)
- Exception messages reappears constantly! (Windows NT / 2000 / XP)
- Arithmetic Exceptions and exception-handling statements (Java)
Other Threads in the C++ Forum
- Previous Thread: How do I get a value to pass on from one function to the next.
- Next Thread: Simulation for CPU Scheduling
Views: 355 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll dynamic encryption error file forms fstream function functions game givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort stream string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






