Thanks for quick helps, i got the first code and JSoftware's version compiled and i think working well. Good signs is both functions acted about same way in my program. But the problem was not solved with that

The actual issue is about "modifying bones"... This means that i have a bone tree, i can focus on 1 bone and when i hold mouse the bone should follow the cursor. For this purpose i have already calculated a virtual plane at which cursor hovers at and creates a 3D point. That point is then transformed into last bone's rotation space. Thus far everything works perfectly, but when i try to get bone rotation towards cursor point it misses the target...