Error 539 - Invalid thread function

Invalid thread function - A valid thread Function may only take one 32-bit LONG or DWORD parameter, which must be received by value ( BYVAL ).  This error can occur if the thread Function does not match the following syntax:

FUNCTION ThreadFuncName (BYVAL param AS {LONG | DWORD}) AS {LONG | DWORD}

An error 539 can also occur if the target thread Function is declared to use a DWORD parameter but is passed a Long-integer, or vice-versa.  You must pass the correct (matching) data type for the thread Function parameter.  For example:

THREAD CREATE MyThread(y&) TO hThread???

[statements]

FUNCTION MyThread(BYVAL x AS LONG) AS LONG

Or

THREAD CREATE MyThread(y???) TO hThread???

[statements]

FUNCTION MyThread(BYVAL x AS DWORD) AS LONG

 

See Also

THREAD CREATE statement