lloydy
July 29th, 2004, 05:38 PM
Hi,
I am using a BeginInvoke call, which is moving to the correct thread, and calling the correct function, but is not passing the arguments!
My code when calling BeginInvoke is:
DataSetArgs* Args = new DataSetArgs(sender, DSN);
//Update the Config
if(System::Windows::Forms::Control::InvokeRequired)
{
Object* pList[] = {this, dynamic_cast<System::EventArgs *>(Args)};
Type* DelegateType = __typeof(System::Windows::Forms::Form);
System::EventHandler *thisEventHandler =
new System::EventHandler(this, &Form1::AutoConfig);
System::Windows::Forms::Control::BeginInvoke(thisEventHandler, pList);
}else
{
AutoConfig(this, EArgs);
}
The function called is:
public: void AutoConfig(Object* sender, System::EventArgs* Args){
//Problem, at this points, args is empty
}
Can anyone see why this is not being passed?
Thanks in advance
I am using a BeginInvoke call, which is moving to the correct thread, and calling the correct function, but is not passing the arguments!
My code when calling BeginInvoke is:
DataSetArgs* Args = new DataSetArgs(sender, DSN);
//Update the Config
if(System::Windows::Forms::Control::InvokeRequired)
{
Object* pList[] = {this, dynamic_cast<System::EventArgs *>(Args)};
Type* DelegateType = __typeof(System::Windows::Forms::Form);
System::EventHandler *thisEventHandler =
new System::EventHandler(this, &Form1::AutoConfig);
System::Windows::Forms::Control::BeginInvoke(thisEventHandler, pList);
}else
{
AutoConfig(this, EArgs);
}
The function called is:
public: void AutoConfig(Object* sender, System::EventArgs* Args){
//Problem, at this points, args is empty
}
Can anyone see why this is not being passed?
Thanks in advance