How to pass function pointer parameter into CreateThread() wrapper function as exposed in processthreadsapi.mqh
Wasin Thonkaew:
I'm experimenting with the multi-threading code in a Script environment.
I have the following code.
Also I have to typedef ThreadFunction in order to satisfy compilation a little more.
If I didn't use typedef a type as a function pointer then pass into CreateThread() function, then error of
will occur.
The only compile error now is those two lines.
Any suggestion on how to properly pass thread function into CreateThread() function here?
Hi Wasin,
Before I realised that doing what you trying to do does not work, I spent a few weeks trying to find a way, but sadly not doable. The reason for this is that MQL5 does not have real pointers like C/C++. MQL5 has pseudo pointers - so the win32 API function CreateThread() will not work.
All the best,
Shep
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have the following code.
Also I have to typedef ThreadFunction in order to satisfy compilation a little more.
If I didn't use typedef a type as a function pointer then pass into CreateThread() function, then error of
will occur.
The only compile error now is those two lines.
Any suggestion on how to properly pass thread function into CreateThread() function here?