It depends on how far we have gone in the relationship.
If it is just a simple interest and I found out she is not interested in me, I can brush it off over night easily.
If we became good friends, actions made me believe we would be starting a relationship in the future, and then find out a relationship will never happen ... then it can take me some time to let go. I go through the usual stages of denial, anger, hopeful, etc. It may take me a few weeks to let go, but it will happen.
Ultimately my attitude is "She doesn't want a relationship, so lets look somewhere else". I'll still be a good friend to her because it would suck to loose what has been developed.