|
Okay this one is for the Gurus!
I am trying to open multiple modal dialogs from a parent modal dialog. However, in modal dialogs only one child dialog can be opened at a time under a parent dialog. Therefore, I have to use the applications main window to have multiple modal dialogs opened and use a map to track which dialogs belong to the parent dialog.
How can I get a handle or pointer to the childrens dialog windows to store them in my map (for the parent to track)?
My goal is to close all the parent's children dialogs once the parent's has been closed. And also consistently close them out by calling theDlg->EndDialog(IDOK) when the parent dialog has been closed by clicking "OK" or theDlg->EndDialog(IDCANCEL) when the parent dialog has been closed by clicking "Cancel".
|
|
|
|
|
AeJai wrote: I am trying to open multiple modal dialogs from a parent modal dialog
Multiple modal dialogs...so, which is active - there can only be one at a time. Also, once a modal dialog starts, the only way for it to communicate with its parent window is by exiting - it contains its own message loop rather than using its parent window's message loop.
AeJai wrote: My goal is to close all the parent's children dialogs once the parent's has been closed
A parent window cannot be closed if it has spawned a modal dialog.
Just don't do it - 'multiple modal dialogs' is really a synonym for 'modeless dialogs', IMO. You can close the child modeless dialogs by posting WM_CLOSE messages to them, IIRC.
|
|
|
|
|
The reason the parent window can be closed is because its parent too is the main window's (i.e., (long)AfxGetMainWnd()->m_hWnd) as well as its children. This allows for all the modal dialogs to open and not continue in the code sequentially until OK or Cancel has been clicked.
I need to open more dialogs from this parent dialog in order to compare and modify values (of the contents). I cannot use modeless dialogs because it continues computing without the user selecting OK or Cancel; it just creates the dialog and will create multiple dialogs of the same type or instance rather. I have been able to reactivate the dialog that has been opened already by using a PropertyFrame pointer.
I cannot just close the dialogs via WM_CLOSE, but should prevent the parent dialog from closing as long as its children dialogs are opened. That too will be as difficult.
|
|
|
|
|
I want to transform a modal dialog box into a modeless so I can drag and drop items from the interface in the main window (in a SDI application) into my dialog box. That bit, I can do - I allocate dynamically the dialog box and call CreateWindow. But I don't want the user to be able to click on the menu or the toolbar (or about anywhere actually except a treecontrol where the drag & drop will start from).
Is this achievable without having to add code on every single menu handler?
Thanks in adavance!
|
|
|
|
|
In general, you'd use ON_UPDATE_COMMAND_UI handlers to disable the menu commands and associated toolbar buttons. You could have a single handler method to deal with all the menu commands, but you'd have to declare them all in the appropriate message map.
|
|
|
|
|
Hi Stuart,
Thanks for this - but I do not want to have to write a handler / or modify existing handlers for every single of them!
|
|
|
|
|
You don't have to - write one method to handle the ON_UPDATE_COMMAND_UI thing, then register that one (ONE) method for all the ON_UPDATE_COMMAND_UI things you need to handle.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Oh - and you can use ON_UPDATE_COMMAND_UI_RANGE[^] to register one handler for multiple command IDs in one go.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Sounds like a user interface that would cause me to close and uninstall that software. Perhaps you should consider a different design?
|
|
|
|
|
Thanks for your helpful remark
|
|
|
|
|
I wanted to display the time zone set by the system on a dialog in static text.
For example : The time zone in India is (GMT+05:30) Chennai, Kolkata, Mumbai , NewDelhi.
Now if I change it to some other like (GMT+09:00)Osaka, Sapporo, Tokoyo.
Then I want this statement to be appeared after refersh.
Please let me know how can it be possible???
Thanks in Advance
|
|
|
|
|
I'm not very clear about your question, but if you want to be notified when the time zone changes, look at WM_TIMECHANGE .
«_Superman_»
|
|
|
|
|
GetTimeZoneInformation will give you the (+900) part - but not the city list.
I suspect that only lives in the common dialog used, so you may be out of luck.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
For now i think that can be enough. Can you give me any sample code using that function.
|
|
|
|
|
Not without reading the documentation page, calling the function, looking at the contents of the TIME_ZONE_INFORMATION.
All of which you can do yourself.
(It's not a function I've used, it's one I found on msdn)
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi,
I have an xml file which I want to encrypt using Public /Private key encryption technique.
Could any body give info/code snippet or an sample project which has implemented Public Key encryption technique using public and private key pairs which I would use in my project.
Thanks & Regards.
|
|
|
|
|
Is here at CodeProject any article about?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
I have implemented dialog based application with a static text control on it, the length of static text changes dynamicaly, and I want to set the width of dialog box so that only static text should get display(single line), as per length of static text dialog box width get changes.
So please give me hint or solution.
Thanx
|
|
|
|
|
exactly what you need[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
crazy_sam wrote: So please give me hint or solution.
See the Extras section of this article.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Thanks to everyone for your kind reply..
here is the position where I am now.
I am giving my re explaining my problem again.
There is absolutely no problem when I compile the program without a header file (which is a .h file of ACE framework) ie #include "Defines.h"
#include "conio.h"
#include "time.h"
#include "WaveRecorder.h"
#include "MultiXtR.h"
#include <queue>
#include <vector>
using std::vector;
using std::queue;
//#include "Defines.h"
class MultiXtrPortDigitalTapDriver
{
public:
...
static vector <int> m_staVecActivePorts;
static vector <int> m_staVecActiveExtention;
...
...
But when i include the header file ...it gives error...I think its clash/redefinition..
the errors are....
c:\program files\microsoft visual studio\vc98\include\ios.h(103) : error C2371: 'streambuf' : redefinition; different basic types
c:\program files\microsoft visual studio\vc98\include\iosfwd(255) : see declaration of 'streambuf'
c:\program files\microsoft visual studio\vc98\include\ios.h(104) : error C2371: 'ostream' : redefinition; different basic types
c:\program files\microsoft visual studio\vc98\include\iosfwd(257) : see declaration of 'ostream'
c:\program files\microsoft visual studio\vc98\include\ios.h(106) : error C2371: 'ios' : redefinition; different basic types
c:\program files\microsoft visual studio\vc98\include\iosfwd(254) : see declaration of 'ios'
c:\program files\microsoft visual studio\vc98\include\istream.h(64) : error C2371: 'istream' : redefinition; different basic types
c:\program files\microsoft visual studio\vc98\include\iosfwd(256) : see declaration of 'istream'
c:\program files\microsoft visual studio\vc98\include\iostream.h(66) : error C2371: 'iostream' : redefinition; different basic types
c:\program files\microsoft visual studio\vc98\include\iosfwd(258) : see declaration of 'iostream'
Waveheader.cpp
Now, I need to include the defines.h (in order to use ace framework), and also I need to use the vector and list...
So please provide a solution..
Regards,
Himangshu
<div class="ForumMod">modified on Monday, February 9, 2009 11:21 PM</div>
|
|
|
|
|
When you want to use < characters in messages, you have to check the "Ignore HTML tags in this message" because we can't see anything. And it's quite difficult to help you then...
Anyway, did you include the header file of the class that you are using as template parameter for your vector (I don't know what it is because I can't read it).
|
|
|
|
|
Thanks cedric,
Yes, I have used the header file
#include <vector>
Thanks
I am a learner Always
|
|
|
|
|
No, I was talking about the header file of the class which you are using as template parameter for the vector. So, the class which is between the < > (if it is a class).
But please, edit your first message and follow my advice, otherwise people won't be able to help you much.
|
|
|
|
|
I get it correct by using
#include "iostream.h"
using namespace std
No problem at all.It works fine.
But, I don't want to use the header file(iostream) since there is again a conflict between some functions with ace framework,which I am using in my program.
Thank you
I am a learner Always
|
|
|
|