Hi All. Well, I have been trying a few things to solve this problem, but please let me set the sage first.
I have a .net 2005 class lib in C++ that is using fastdelegates to wrap a VC6 DLL that has callbacks. The VC6 DLL callsback fine to the 2005 class lib and when the callback tries to do something like...
void SetText(String ^s)
{
if ( ccl.InvokeRequired )
{
SetTextCallback ^d = gcnew SetTextCallback(this,&Classname::SetText);
ccf.Invoke(d,gcnew String { s } );
}
else
{
ccl.Items->Add(s);
}
}
eventually the program gets "stuck" when trying to return back to the main call to the VC6 DLL that generates the callbacks. When we break in the debugger, the top of the call stack is "[Managed to Native Transtion]" and the next frame is the call to the VC6 DLL.
It seems that when the invoking is done, it is exhibiting some sort of bug that does not allow the call to the VC6 DLL to return, it just "spins" forever.
Has anyone seen this? Any help on how to trace it down / fix?
Thanks in Advance.