I have an MFC application. My application class is derived from CWinApp. It implements OnFileOpen(). When the user selects File -> Open, this method is called. But my users usually open documents in another way: they just drag a document file to the .exe file, and the document opens with my program. But this way, OnFileOpen() is not called. Where should I place my code then to make sure it is called in any scenario?