Code explorer will always take the file which is currently open, I think you are seeing .cydwr file when code explorer is giving this error.
You just need to open the main.c, then the code explorer will work as expected.
I've resolved this problem as an issue with running PSOC Creator under Parallels on a mac. Things just don't work as well as they should and sometimes this happens. I switched to vmware which ran a little better but ultimately just ended up getting a PC to run this on. It runs much better under a clean PC environment. Thanks for folks help.