Isn't there a way to know the ip before joining the channel?
Sure, if you're psychic, and know which nicks are in the channel you're about to join.
If you are, use /userhost <nick> [nick2] [nick3] [etc]
Otherwise, no, you can't.
mIRC needs to receive the hosts from the server in order to know them.
The server won't give you a user's host, unless you do /userhost, or /whois on them.
Or, if you're receiving output from a command this user did, such as a private message with the user, or a notice.