amibroker

HomeKnowledge Base

Third-party plugins must use multithreaded run-time

All developers of 3rd party plugin should NOT change the default project settings that are provided in sample projects in the ADK. If you change anything, you must make sure that you are using multi-threaded C runtime library as shown below:

MTsettings

It is absolutely essential to check this setting, as the default for Visual C++ 6.0 static links is to use single-threaded version. Also you should avoid static linking to C runtime. It only makes your DLL bigger and unsafe (because security fixes applied by Windows update can’t fix statically linked programs).

So, once again you absolutely need to make sure that your plugins use “Multithreaded DLL” run-time library.

Failure to do so results in bizarre crashes, mainly occurring in OS Kernel at InterlockedDecrement or at RtlInterlockedFlushSList calls.

Note that this applies NOT ONLY to multi-threaded editions of AmiBroker but to ALL editions, since you must not mix run time libraries within single application.

Note also that most recent editions of Visual C++ compilers (2005 and 2010) do not allow to choose single-threaded runtime anymore.