MyDac Component and Multithreading ...
Posted: Wed 14 Mar 2007 15:54
Hello !!!
Can I use MyDac Component (TMyQuery,TMyCommand) in a multithreading application ...
I have a 2 tables master - detail so I want to create a function that calculate sum of items in detail table after each Post then assign this sum to a field in master table ... so can i Create a function that use TMyCommand to do this (in thread).. if you can help me giving an example..
this is what i did :
Form1::detail_tableAfterPost(....)
{
HANDLE f;
DWORD d;
f = CreateThread(0,0,CalcSum,NULL,0,d);
}
DWORD WINAPI CalcSum(LPVOID)
{ MyCommand1->Execute();
}
so when i must terminate this thread ..
thank you ...
Can I use MyDac Component (TMyQuery,TMyCommand) in a multithreading application ...
I have a 2 tables master - detail so I want to create a function that calculate sum of items in detail table after each Post then assign this sum to a field in master table ... so can i Create a function that use TMyCommand to do this (in thread).. if you can help me giving an example..
this is what i did :
Form1::detail_tableAfterPost(....)
{
HANDLE f;
DWORD d;
f = CreateThread(0,0,CalcSum,NULL,0,d);
}
DWORD WINAPI CalcSum(LPVOID)
{ MyCommand1->Execute();
}
so when i must terminate this thread ..
thank you ...