Color me dumbfounded!

I just got (yesterday) a Windows 2000 workstation because my company will be converting from Win98 to 2000 later this year. I now have two PCs. My Win98 box is my development box. I have nine applications currently in production, and one of the things I need to do is ensure that all nine apps will work on Windows 2000.

Gknuth posted a question asking how to get the logged in UserName, and I responded. He came back and said that the GetUserName API didn't work on Win2K. I said to myself "yeah, right…what did you do wrong?" I went to my Win2K box, opened a new project, and pasted the GetUserName code onto a form, ran it, and it came up blank. To say I was shocked is an understatement, and here is why.

I ran each of the nine apps I have in production. All nine use GetUserName and GetComputerName. In all instances, the logged in UserAccount (mine) was properly returned and the ComputerName (mine) was also properly returned. Each of the applications were developed and compiled on a Win98 box, and ported to Windows 2000.

So, it seems that if an application is developed on Win98, and ported to Windows 2000 these two APIs work, but if you try to use them in a New Project started on a Windows 2000 box, they don't.

Does anyone know why?