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. in dialog dll because of App class instance application being crashed

in dialog dll because of App class instance application being crashed

Scheduled Pinned Locked Moved C / C++ / MFC
c++debugginghelp
5 Posts 3 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.
  • A Offline
    A Offline
    appollosputnik
    wrote on last edited by
    #1

    I have dll where I am creating a dialog whihc is shown from the mfc client application. I loading this dll as an extension dll, then by implementing Do.Modal() function I am showing the dialog which has menus, toolbars,black model visualization screen. When trying to display this screen, it's crashing as debug ASSERT failed, at appcore.cpp ASSERT(AfeGetThread()==NULL) My App class is like this in the header file I have the App constructor and in .cpp file I have the construcor and also one instance of ViewApp as below //MyViewApp.h [code] //Inside the class definition MyViewApp(); //constructor dclaration //outside the class definition extern MyViewApp theApp; [/code] //MyViewApp.cpp [code] MyViewApp::MyViewApp() { } MyViewApp theApp; [/code] It's crashing with this code (ASSERT failure in appcore.cpp), and when I am removing this constructor declaration and definition and also removing the one instantiation, then it's not crashing but coming out of the application, My Dialog GUI is not launching. Please help me whats going wrong in this. Thanks a lot for help in advance.

    C S 2 Replies Last reply
    0
    • A appollosputnik

      I have dll where I am creating a dialog whihc is shown from the mfc client application. I loading this dll as an extension dll, then by implementing Do.Modal() function I am showing the dialog which has menus, toolbars,black model visualization screen. When trying to display this screen, it's crashing as debug ASSERT failed, at appcore.cpp ASSERT(AfeGetThread()==NULL) My App class is like this in the header file I have the App constructor and in .cpp file I have the construcor and also one instance of ViewApp as below //MyViewApp.h [code] //Inside the class definition MyViewApp(); //constructor dclaration //outside the class definition extern MyViewApp theApp; [/code] //MyViewApp.cpp [code] MyViewApp::MyViewApp() { } MyViewApp theApp; [/code] It's crashing with this code (ASSERT failure in appcore.cpp), and when I am removing this constructor declaration and definition and also removing the one instantiation, then it's not crashing but coming out of the application, My Dialog GUI is not launching. Please help me whats going wrong in this. Thanks a lot for help in advance.

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      My guess would be that you already have a CWinApp derivate instantiated while CWinApp (and so your MyViewApp since it is also a derivate of CWinApp) expects to be the one and only. Sad that in wincore.cpp there seems to be no comment whatsoever around those ASSERT-s to give you some additional information about what's wrong. I suspect that you have MyViewApp inside the DLL and you are loading it into your application which already has a CWinApp derivate. If so, you should try displaying and handling your dialog in the "context of the original application". Could this be it?

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > If it doesn't matter, it's antimatter.<

      A 1 Reply Last reply
      0
      • C Code o mat

        My guess would be that you already have a CWinApp derivate instantiated while CWinApp (and so your MyViewApp since it is also a derivate of CWinApp) expects to be the one and only. Sad that in wincore.cpp there seems to be no comment whatsoever around those ASSERT-s to give you some additional information about what's wrong. I suspect that you have MyViewApp inside the DLL and you are loading it into your application which already has a CWinApp derivate. If so, you should try displaying and handling your dialog in the "context of the original application". Could this be it?

        > The problem with computers is that they do what you tell them to do and not what you want them to do. < > If it doesn't matter, it's antimatter.<

        A Offline
        A Offline
        appollosputnik
        wrote on last edited by
        #3

        how can I do that please give me some hint.. I have one api exposed for mfc client called 'runAppli' [code] __declspec(dllexport)runAppli(CString fileName) { CDlgsViewDlg dlg(fileName, NULL); dlg.DoModal(); return true; } [/code] Using this I am calling the dll after loading. So how can I displaying and handling your dialog in the "context of the original application". Please give me some hints.

        C 1 Reply Last reply
        0
        • A appollosputnik

          how can I do that please give me some hint.. I have one api exposed for mfc client called 'runAppli' [code] __declspec(dllexport)runAppli(CString fileName) { CDlgsViewDlg dlg(fileName, NULL); dlg.DoModal(); return true; } [/code] Using this I am calling the dll after loading. So how can I displaying and handling your dialog in the "context of the original application". Please give me some hints.

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          Hard to say without seeing the whole picture, but... Am i right that you have an application class instantiated in both the DLL and the app that loads it? If yes, do you need an application class inside the DLL? If yes, why? If no, try to get rid of it and see if it helps.

          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > If it doesn't matter, it's antimatter.<

          1 Reply Last reply
          0
          • A appollosputnik

            I have dll where I am creating a dialog whihc is shown from the mfc client application. I loading this dll as an extension dll, then by implementing Do.Modal() function I am showing the dialog which has menus, toolbars,black model visualization screen. When trying to display this screen, it's crashing as debug ASSERT failed, at appcore.cpp ASSERT(AfeGetThread()==NULL) My App class is like this in the header file I have the App constructor and in .cpp file I have the construcor and also one instance of ViewApp as below //MyViewApp.h [code] //Inside the class definition MyViewApp(); //constructor dclaration //outside the class definition extern MyViewApp theApp; [/code] //MyViewApp.cpp [code] MyViewApp::MyViewApp() { } MyViewApp theApp; [/code] It's crashing with this code (ASSERT failure in appcore.cpp), and when I am removing this constructor declaration and definition and also removing the one instantiation, then it's not crashing but coming out of the application, My Dialog GUI is not launching. Please help me whats going wrong in this. Thanks a lot for help in advance.

            S Offline
            S Offline
            Stephen Hewitt
            wrote on last edited by
            #5

            sujandasmahapatra wrote:

            It's crashing with this code (ASSERT failure in appcore.cpp)

            appcore.cpp is a big place! Whenever you ask for help and say an ASSERT is failing for the love of god paste in the code around the ASSERT statement.

            Steve

            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