Hello,
I have been working on getting multithreading to work.
I have a function which does NOT contain DARKGDK related functions.
It compiles, and runs for a couple of seconds (around 5 secs) than gives me an exception:
...and then points to something totally irrelevant in the code, but in the Call Stack tab he shows something (interesting?):
This is the code to create thread:
DWORD qTHREADID;
HANDLE Thread = CreateThread(0,0,qCFVThreadFn,0,0,&qTHREADID);
This is the code to close Thread:
This is the function name:
DWORD WINAPI qCFVThreadFn(LPVOID vpParam)
This is the function code:
while(true)
{
cfv.update();
for(int i=0; i<cfv.data.size(); i++)
{
if(cfv.data[i].visible == true)
{
for(int c=0; c<cfv.data.size(); c++)
{
if(cfv.data[c].visible == true)
{
if(i!=c)
{
if( ( cfv.data[i].iScreenCenterX>(cfv.data[c].iScreenCenterX-cfv.data[c].iScreenWidth/2) ) && (cfv.data[i].iScreenCenterX<(cfv.data[c].iScreenCenterX+cfv.data[c].iScreenWidth/2) ) && (cfv.data[i].iScreenCenterY>(cfv.data[c].iScreenCenterY-cfv.data[c].iScreenHeight/2) ) && (cfv.data[i].iScreenCenterY<(cfv.data[c].iScreenCenterY+cfv.data[c].iScreenHeight/2) ) )
{
if(cfv.data[i].distance > cfv.data[c].distance)
{
if( (cfv.data[i].iScreenHeight < cfv.data[c].iScreenHeight) && (cfv.data[i].iScreenWidth < cfv.data[c].iScreenWidth) )
{
cfv.data[i].visible = false;
//dbHideObject(cfv.data[i].id);
}
else
{
cfv.data[i].visible = true;
//dbShowObject(cfv.data[i].id);
}
}
}
}
}
}
}
}
}
Note: Nothing related to that code is using DARKGDK commands.
If you need any more code, I would be happy to email it to you.
Can it be it is out of Memory?
Cheers,
Leo