want to keep a window alive
-
I call a dll from am MFC app MyApp From the dll I instantiate a CDialog like so tests = new CTests(0); I thought this would 'detach' the CDialog from the dll. Now after the dll has done its job, when I go to dismiss myApp, this CDialog vanishes too. I want to keep it around, but do want to get rid of MyApp. How do I manage this? I thougt for sure that putting the parent pointer as 0 would have done the trick.... :~ sb
-
I call a dll from am MFC app MyApp From the dll I instantiate a CDialog like so tests = new CTests(0); I thought this would 'detach' the CDialog from the dll. Now after the dll has done its job, when I go to dismiss myApp, this CDialog vanishes too. I want to keep it around, but do want to get rid of MyApp. How do I manage this? I thougt for sure that putting the parent pointer as 0 would have done the trick.... :~ sb
All that code executing the window in the DLL belongs to your MyApp process, so when the MyApp process is gone, so is the DLL and the dialog. You might be able to hide the window for the MyApp, and thus still have the window from the DLL visible and processing user inpout on the screen. I've seen better runs in my shorts! - Patches O'Houlihan
-
I call a dll from am MFC app MyApp From the dll I instantiate a CDialog like so tests = new CTests(0); I thought this would 'detach' the CDialog from the dll. Now after the dll has done its job, when I go to dismiss myApp, this CDialog vanishes too. I want to keep it around, but do want to get rid of MyApp. How do I manage this? I thougt for sure that putting the parent pointer as 0 would have done the trick.... :~ sb
From the design point of view, you need to understand these questions yourself: Why do I want to keep the dialog when I terminate my app? What is the purpose of the dialog, of the app? After I terminate the app, what does my dialog do? - It's easier to make than to correct a mistake.
-
From the design point of view, you need to understand these questions yourself: Why do I want to keep the dialog when I terminate my app? What is the purpose of the dialog, of the app? After I terminate the app, what does my dialog do? - It's easier to make than to correct a mistake.
-
The CDialog is an addon to an existing app. Ithas a progres bar on it, plus a histogram and the user wants to retain this window and be able to proceed further. Right now he can't proceed further if this app is not shut down.
You should make that dialog part of your app, instead of an addition. This way, your app will be cleaner and more robust. That being said, if you insist, you could keep the dialog alive after you terminate the app. Follow these steps: 1) Write another little app2, which handles the dialog. 2) Spawn app2 from within app. 3) Terminate app. This will no doubt create unnecessary complexities to your application. - It's easier to make than to correct a mistake.