The sample goes. Resource only DLL includes IDD_YOUR dialog template. Regular DLL includes IDD_MY dialog template, but implements both classes, CMyDialog and CYourDialog. Hope this close enough to what you're trying to implement.
Thanks for your sample. Actually CMyDialog and CYourDialog are defined in two different dll. Basically what happens is that an exe launches CMyDialog defined in MyDll.dll and then when CMyDialog is NOT dismissed, CYourDialog is launched from defined in YourDll.dll. I would really appreciate it if you can post a sample by using MFC. Thank you very much!
Basically what happens is that an exe launches CMyDialog defined in MyDll.dll and then when CMyDialog is NOT dismissed, CYourDialog is launched from defined in YourDll.dll. I would really appreciate it if you can post a sample by using MFC.
I wonder if you weren't able to look at the sample. In there, exe launches CMyDialog defined in regular dll, and CYourDialog is launched from the CMyDialog when the latter is NOT dismissed. And the sample is all about using MFC classes. Larry, you really should pay some more attention to communication you're participating in.
Basically what happens is that an exe launches CMyDialog defined in MyDll.dll and then when CMyDialog is NOT dismissed, CYourDialog is launched from defined in YourDll.dll.
It doesn't matter where you launch your dialog from. Once you know how to launch it from exe, the same technique is applicable to launching from dll. Sample attached. Here you can see how CYourDialog gets launched from client.exe and my.dll using the same AFX_MANAGE_STATE.
Last edited by Igor Vartanov; September 10th, 2012 at 01:51 AM.
It doesn't matter where you launch your dialog from. Once you know how to launch it from exe, the same technique is applicable to launching from dll. Sample attached. Here you can see how CYourDialog gets launched from client.exe and my.dll using the same AFX_MANAGE_STATE.
Thanks for your sample code. When I run the make file in my computer from command line, the system complained that "rc" and "cl" is not recognized as an external or internal command. And then I create a MFC dialog based project in VC2010 and put all of your files into the project. When I build this project, I got a linker error " LNK1104: cannot open file 'my.lib' ". I attached this project with this post. Would you please tell me what I am missing? Thanks.
Well, the answer to the make issue is Visual Studio Command Prompt.
Actually I tried to run vcvarsall.bat from the folder C:\Program Files\Microsoft Visual Studio 10.0\VC. Then if I run your make.bat in project folder, I still got the same errors. It looks like vcvarsall.bat didn't set up the environment for me to run make.bat. What am I missing here?
BTW, I have fixed the dialog launching problem. It turns out that one of my DLLs to launch the dialog is a MFC extension dll. I couldn't use AFX_MANAGE_STATE like regular dll. So I have to manually set up the resource handle for this dll. It works. Thank you very much!
Actually I tried to run vcvarsall.bat from the folder C:\Program Files\Microsoft Visual Studio 10.0\VC. Then if I run your make.bat in project folder, I still got the same errors. It looks like vcvarsall.bat didn't set up the environment for me to run make.bat. What am I missing here?
I'm currently able to build with the make.bat same successfully in standard Command Prompts of VS2010 and VS2012 Tools, as well as VS .NET2003. In fact I use this approach to make since Visual Studio 4, and never had any problem with this.
Its interesting and , I feel that you want to just check out all possibilities in MFC and VC++ .
Anyways,
Your scenarios is Application A loads dll D1 contains dialog "Mydialog"
then dll D1 loads D2 that contains "YourDialog".
Now App is able to load MyDialog from D1 and you want to load YourDialog from D2 in the code of D1.
I agree to the solutions given by Igor , Victor and all others.
Apart from that just one suggestion is instead of doing DOModal() on YourDialog try to invoke it as modal less.
or may be invoking both the dialogs modal less.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.