hi i am currently doing a project, and want to build in MFC...however i have just started working on it and find it really confusing...
i have some doubts..please clear it as this is really very urgent(i have to complete the gui in a very short time)

1) I have my main code in visual c++, which runs on command line.My next step is to build a gui on mfc, so that instead of typing the command, i am just able to click on the button(made on mfc) to execute the code.

However i am unable to understand how to link my cpp file with the command button.

2)To try the above i had made a simple printf("hello world ") program in a cpp file in a function hello(). And in the onclick event of the button i had simply called the function .but i am getting an error message as follows

fatal error C1010: unexpected end of file while looking for precompiled header directive

3)..Will i have to replace the printf statements in my cpp code or will it work fine..

Please reply asap!!!!!

Thanks in advance

Better replace printf by cout ,etc .

Try to disable precompiled headers in the properties of the file causing the error message. You can find it in section "C/C++" and then "precompiled headers"

commented: Sounds good to me - PCH is a disease, turn it off. +27