How do I get a worker thread to modify a CDocument? No matter what I do, my program crashes.