I am developing an mfc application for windows mobile 5. When i run the application first time after hard resetting and installing the application on the device it gives me the error " Failed to create empty document". But when i run it again i.e on second instance, it doesnt give me that error and runs absolutely fine. I am unable to identify the root of this error. Can somebody suggest me the cause and the measure to prevent it.