I wouldn't compliment a girl EVER, unless I was doing it in a ****y and funny manner.
Example:
Me: Nice glasses.
Her: Thanks! (Wow, is this guy trying to pick me up, ugh.)
Me: Did you get them at Home Depot?
Honestly, I wouldn't compliment a girl at all, you will show yourself as being needy and wanting approval. Remember you are a player, and you DON'T need a girls approval for anything. The moment she realizes you want her, she will NOT want you anymore. Don't make that mistake!
The only time I would compliment a girl is when attraction has already been built and you are in a somewhat relationship. And even than, I would stay away from the, "You are so beautiful" etc etc.
Only compliment a girl on things she wears, NOT her looks.
Also, to answer your second question. Even though that was a somewhat good example of ****y humor; I would only use examples such as these ones when you are with a girl who you are somewhat familiar with, otherwise you will appear to be an *******. Remember, its called ****y+funny for a reason - don't just be ****y! If you aren't making the girl laugh while complimenting yourself at the same time, you aren't doing ****y humor.
A possible mistake you could have made is with your BODY LANGUAGE. Remember, a big part of this technique is your body language. What is body language? Things such as putting an exaggerated smile after you say the joke, or having a smile on your face while saying your joke. If you go up to her with a serious face and tell her, it will appear to be very OFFENSIVE; and than you lost your chance with a potential girl.
Anyway - Hope I helped and answered your question,
Nick.