Hey Pete
I found the "Problem": FPCuser.pas Lines 245 ff
// send the request (allow up to 9 tries)
while (i < 10) and ((SendMessageTimeout(
m_hWnd, // FS6 window handle
m_msg, // our registered message id
m_atom, // wParam: name of file-mapping object
0, // lParam: offset of request into file-mapping obj
SMTO_BLOCK, // halt this thread until we get a response
2000, // time out interval
dwError)) = 0) do
begin // return value
Inc(i);
Sleep(100); // Allow for things to happen
end;
if (i >= 10) then
begin // Failed all tries
if GetLastError = 0 then dwResult := FSUIPC_ERR_TIMEOUT
else dwResult := FSUIPC_ERR_SENDMSG;
Result := FALSE;
Exit;
end;
The Programm didn't freeze, but I had so many Request that it seemed so. With a sleep time of 100ms and 10 retries every failed request makes up 1 sec.
I modified these lines a little but and my programm too.
I had many timers requesting data every 500ms or so. With many timers that "freeze time" add up pretty quick. Now I check at the beginning of each timer and exit the function if not connected any more.
I changed the lines mentioned above to the following:
// send the request (allow up to 9 tries)
while (i < 1) and ((SendMessageTimeout(
m_hWnd, // FS6 window handle
m_msg, // our registered message id
m_atom, // wParam: name of file-mapping object
0, // lParam: offset of request into file-mapping obj
SMTO_BLOCK, // halt this thread until we get a response
50, // time out interval
dwError)) = 0) do
begin // return value
Inc(i);
end;
if (i >= 1) then
begin // Failed all tries
if GetLastError = 0 then dwResult := FSUIPC_ERR_TIMEOUT
else dwResult := FSUIPC_ERR_SENDMSG;
Result := FALSE;
Exit;
end;
Do you think that could be a problem? I didn't find any problems while testing it.
Hope others having same problems can solve them too!
Thanks again
Christoph