Thanks for reply.
But now there is a strange situation if I simply click the .dsw file and then open and run the application then I am getting the same error but if I launch the Visual Studio from the bat file from the program menu then there is no error.
The application just run correctly.