This problem has been encountered by many people. To resolve it, you can try to replace the 'Mss32.dll' file from your KOTOR 2 game directory (e.g. C:\Program Files\Lucasarts\SWKOTOR2) with the same file from KOTOR 1 game directory (e.g. C:\Program Files\Lucasarts\SWKOTOR1). If you don't want to install KOTOR 1 game only to get a file, you can use Google to find it. This should solve the problem and you will be able to play the game without any issues.