The return value of this InvalidateRect = 1 which is telling us the function seems OK.
It is removed from the code right now. And indeed, compiling can even give problems.
In the past I have solved many problems using malloc, etc...
Anyway, thanks for the interesting talkings.