Paul, that code was made by the creator, not by me. The thing is, that function adds the method to some static list of compression methods elsewere, and that list is used... This static variable, however, is not.
Does the compiler remove code even without any optimizing option?
By the way, all works fine on the dll with the same source. Is something different for a dynamic library on this regard?

Thank you for your help.