problem with multiple use of the same COleControl
Hi
I have the following problem: There is a class MyControl derived from COleControl (which then I want to use in another project )
which has implemented
void func1()
{
<do sth on global resources(to draw sth)>
}
When use many instances of it in mysecond project
for(int i=1;i<10;i++)
{
MyControlTab[i].func1()
}
at the same time func1 is beeing called from several controls making acces violation. I was trying to use waiting loops (with Sleep) in func1 or in the "for loop" but all in vain.
But when I put in the "for loop" AfxMessageBox -so main program is waiting for user resond while current control from the loop can end func1 separatelly everythings works good -
-so I guess it's a problem of COleCotroll message dispatching scheme.
Can any give me a piece of advice or give me a link concerning his subject
Thanks in advance
dj