Cancel opening a file
-
I am working on an application that has the ability to open files using MFC and Visual Studio .Net 2003. I need give the user the option not to continue opening the file for special cases or scenarios. The determination is based on a keyword setting in an XML tag. Using the Serialize method, I was able to modify the software to not continue loading the file. However, it loaded it anyways but not completely. Do you know how I can prevent it from loading a file completely?
-
I am working on an application that has the ability to open files using MFC and Visual Studio .Net 2003. I need give the user the option not to continue opening the file for special cases or scenarios. The determination is based on a keyword setting in an XML tag. Using the Serialize method, I was able to modify the software to not continue loading the file. However, it loaded it anyways but not completely. Do you know how I can prevent it from loading a file completely?
Have your Serialize method throw a CArchiveException. This will cause CDocument to totally cleanup the partially loaded file.
AfxThrowArchiveException(CArchiveException::none);
You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!