Default Ring tone

I am trying to modify the ring tone in a c++ program. I have manage to write the ring tone in the registry. If I receive a call I do not hear any ring tone. If I use the registry editor that comes with Evc++ 4 and open the key “hkey_current_user\controlpanel\ringtone0\sound” and then close it with out modifying it and receive another call the ring tone works.
I don’t know what is the problem.

Can some one help me pleas