You have to cancel the visit visa. Then, proceed with the resident visa process. There is no need for exit if you go through the right channel. Good Luck!