Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. While launching a winapp as ole server some time OnFIleNew() failed

While launching a winapp as ole server some time OnFIleNew() failed

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpwpfcomsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vermaashish_mca
    wrote on last edited by
    #1

    Hi While launching a MFC application(.exe) as OLE server, some time CWinApp::OnFileNew() gets failed; due to this frame window cannot be created and handle to the main window (m_pMainWnd) becomes NULL and error message "Error occurs in mfc42.dll" appeared. At windows XP, CWinApp::OnFileNew() failed in 1 out of 100 times. We have not implemented the OnFileNew() in our application; we are using default implementation of OnFileNew(). As per MSDN CWinApp::OnFileNew implements this command differently depending on the number of document templates in the application. If there is only one CDocTemplate, CWinApp::OnFileNew will create a new document of that type, as well as the proper frame and view class. Problem occurs only at one system and frequency is one out of 100 and error message "Error occurs in mfc42.dll" appeared. Thank You

    Ashish Kumar verma Software Engineer(VC++)

    J 1 Reply Last reply
    0
    • V vermaashish_mca

      Hi While launching a MFC application(.exe) as OLE server, some time CWinApp::OnFileNew() gets failed; due to this frame window cannot be created and handle to the main window (m_pMainWnd) becomes NULL and error message "Error occurs in mfc42.dll" appeared. At windows XP, CWinApp::OnFileNew() failed in 1 out of 100 times. We have not implemented the OnFileNew() in our application; we are using default implementation of OnFileNew(). As per MSDN CWinApp::OnFileNew implements this command differently depending on the number of document templates in the application. If there is only one CDocTemplate, CWinApp::OnFileNew will create a new document of that type, as well as the proper frame and view class. Problem occurs only at one system and frequency is one out of 100 and error message "Error occurs in mfc42.dll" appeared. Thank You

      Ashish Kumar verma Software Engineer(VC++)

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      From your information it is rather impossible to guess what is wrong. But I will give you some notes that may help you to find the problem or enhance your question: "Error occurs in mfc42.dll" seems to be an application specific error message (googling the exact term gives only a few results). So you should be able to locate the executed source sections before the error occurs. Even when using the default implementation of OnFileNew(), virtual functions of your document class are involved. In this case I would especially check OnNewDocument(). When this returns FALSE, creation of the document and frame window will be stopped (see the MFC sources for CSingleDocTemplate::OpenDocumentFile()).

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups