Quote Originally Posted by miteshpandey
It can't be. From where are you calling AfxGetMainWnd()
I got it to work, and I don't know why was it not being recognized by my compiler. A lillte while earlier, I had a similar problem with AfxGetApp(). Well, when I used them in a different project, they both work absolutely fine. I am still not sure why was it not being deteced in the old project.