Category: Development

How to create thread from class’s method

Sometimes I need start thread from class method. Compiler return error while compilation.

error C2664: ‘CreateThread’ : cannot convert parameter 3 from ‘unsigned long (__thiscall CMyClass::*)(void *)’ to ‘unsigned long (__stdcall *)(void *)’

Compiler is right. Static function address is needed to CreateThread. But If you start class method you want it should act as class instance method. This problem solves article from here ( in Russian ). Someone advices use boost for that. I believe no need add extra library to solve such a little problem.

Someone added this sample to “bad code samples collection” “bad code samples collection”. I think he don’t really understand context.

Doxygen helps create software documentation from comments, but what can help create comments?

All The “help tools” page of doxygen project gives this answer.  Only one plugin from  the tools listed there interested me.  It called Atomineer. All its futures are listed on official project’s site. In sort: developer writes code – plugin writes comments. It is useful for boring tasks like some function’s parameters enumeration or return codes enumeration. The developers say that then some code  peace is changed, generated comments will also updated automatically. If developer writes self-documented code, then no additional efforts are needed for qualified documentation.

Testing native C++ code with MSVS 2010

New Visual Studio gives large amount of futures for managed code testing. This manual gives testing framework overview. Need to add, that it provide ability for creating testing farm and manage tests in different computers  from one work place.

However, nothing provided for testing native C++ code. Microsoft advises use this simple framework, but it doesn’t give mush functions as MSVS 2010 integrated framework gives for managed code development.
IntelliSence doesn’t work for C++/CLI in MSVS 2010 also. Awful!

Fuzzing, фаззинг, in-memory fuzzing, фаззинг в памяти, vulnerability, уязвимсоти, binary code, бинарный код, static analysis, статический анализ, dynamic analysis, динамический анализ, fault injection, внедрение ошибок, CTF, information security, информационная безопасность, unit testing, тестирование