Re your addition about toughening up: J., we would say that to a mom. We are actually giving you the SAME advice as we would give to a woman. Indeed, this IS the same advice many of us have given to mommies who come on here boohoo'ing about this, saying "My child hates me!" Toughen up means stop taking it personally...
Original:
I want to commend you for trying to be a part of your daughter's life, as much as your wife. But I want you to try to understand that you are not the mama. Your daughter is a mommy's girl right now. And you cannot make her change in that regard until she is able to developmentally.
However, that does NOT mean that EITHER of you allow her to hit you. Your wife should be dealing with this along side of you. If she isn't, the question is WHY?
ANYTIME she hits you, you both tell her "NO hitting. Hands are for helping, not hurting." If you have a play pen or a pack & play, put her in it and walk away. Let her cry. Ignore her. After 4 or 5 minutes, then go to her and ask her if she is ready to behave. The pick her up, set her down on the floor with your face in front of hers and say "I told you that hands are for helping, not hurting. Do you understand me?" She needs to tell you that she is sorry for hitting you.
Have you ever had a bird for a pet? Do you know what they love to do? They love to peck at or bite your finger. Do you know why? They love to ellicit a response. If you jerk away and say ouch, they'll do it over and over again. If you ignore them and pretend they didn't, they stop.
The same thing goes for your daughter. She is elliciting a response out of you by telling you that you don't love her. You need to start ignoring it. The ladies who tell you to get a thicker skin are spot on.
You mention that your wife is pregnant. Yes, this is connected. Why would you think this is stupid? She knows that life is going to change. But 3 year olds can be so difficult without a baby in the picture (terrible two's, trying three's) and it will only get worse. When the baby comes, get your daughter a gift, a toy that she has wanted for a long time, has admired, and when she meets the baby, give it to her and tell her that the baby is so happy to meet big sister and this present is from the baby. The first week that the baby is home, sit down with pictures from when she was a newborn, with mommy and daddy holding her, and tell her that when she was new, you held her like the baby is being held. That will help her see that she was treated with the same loving care. You need to understand - children often get jealous of a new baby. It has been compared to the idea if you got a second wife, how your new wife would feel. Silly, yes, but still, a child gets jealous of a new sibling. It's just the way it is.
Keep telling her that baby loves her. If she acts interested in the bottle, tell her that she is such a big girl and can eat food and play and run and sing, and baby can only drink milk and sleep. Lucky big girl! That will help. Ask her to bring you a diaper, tell her that the baby is her baby too, etc. It will help.
As far as letting you put her to bed is concerned, you need to stop getting your feelings hurt, not allow her to slap you (if you see her hands coming to your face, grab her hands and hold them so that she can't let go and remind her "Hands are for helping..." If she tries to hit you again (not listening to you) then she's in the bed and you walk out of the room, turn off the light and close the door. NO bedtime story. Nothing. She loses her nightie-night privileges when she is mean to daddy.
Your wife will have a lot to do once this baby is born. You BOTH need to make sure that you are consistent with her that she has to let you help your wife. She is also going to be tired and miserable the last month of pregnancy, and a 3 year old trying to be the boss of the house will just not do.
Instead of getting your feelings hurt, you need to be loving but STERN. Your wife needs to say "No, your dad is helping you with that" and walk away. If she has a tantrum, you put her in her bedroom and shut the door until she stops. And then you only let her out when she stops the tantrum. And you NEVER give in to her if she has a tantrum, dad. NEVER. She will think that tantruming will get her what she wants. NO WAY. You have to teach her that all it gets her is stuck in her room.