|
Many thanks, I think I get a better idea with every message you post. I appreciate your help! Even with the actual problem not quite being solved yet, I have learnt heaps already.
If I understand it correctly the CPropertySheet and CPropertyPage classes are for dialogs, that are actually meant to be on top (as individual dialogs, which the user then confirms via OK, CANCEL, (ESC ENTER) etc., so for that you actually don't use the Tab Control elelement from the toolbar, correct?
And the Tab Control is if you want to use it WITHIN an application, where you can also have other control elements, but all of these will still stay within the main window. Would that roughly summarize the difference between PropertySheets/Pages and a stnadard Tab Control?
Thanks in advance for your comments/answers to confirm this.
O.k. I have disregarded the PropSheet stuff for now and tried what you had described with the .Create function.
Well, I think I start to understand the concept, but unfortunately I can't quite get it to work.
I tried putting the
CTest_Tab_Dialog myTestTab;
myTestTab.Create(IDD_PAGE_TestPage3, NULL);
in the OnInitDialog() function, but the compiler doesn't like it: error C2065 undeclared variable
Then I put it in the OnSelchange notification handler function, like this:
void CTestDlg::OnSelchangeTabMenus(NMHDR* pNMHDR, LRESULT* pResult)
{
CTest_Tab_Dialog myTestTab;
myTestTab.Create(IDD_PAGE_TestPage3, NULL);
switch (m_cTab.GetCurSel())
{
case 0: myTestTab.ShowWindow(SW_SHOW);
break; ;
}
*pResult = 0;
}
...now I can compile and run the program. So far so good.
However, my dialog doesn't get called, I mean it is not visible.
Please note, that despite your hint I have not worked yet on the scaling/sizing that you have mentioned in your previous post. But I thought I can sort that out later. I am not worried too much, if the ta content dialog is a bit too small. I first want to see this stupid dialog.
I am not sure what parameter to call the .Create() function with. Maybe you can explain that to me. Just to make it compilable, I have added a NULL, not really knowing what exactly that does; but perhaps that is wrong, too?!
One thing I noticed is that if I very rapidly change between the tabs of my tab control, I can briefly see the content of the dialog. So it appears that Windows is actually drawing it, but only for a very short moment and then it gets overwritten again.
Maybe that helps you to ...help me Thanks for shedding more light on this.
modified on Tuesday, February 10, 2009 4:05 AM
|
|
|
|
|
Try changing
myTestTab.Create(IDD_PAGE_TestPage3, NULL); to
myTestTab.Create(IDD_PAGE_TestPage3, &m_cTab);
«_Superman_»
|
|
|
|
|
Thanks, but that doesn't work either - same behaviour as with NULL.
Remember when I said, that by changing the tabs rapidly I can (very briefly) see a flicker of the dialog, but it gets overwritten instantaneously?
Well, for debug purposes only I did a little trick to force the program to halt, using a simple message box as shown below...
void CTestDlg::OnSelchangeTabMenus(NMHDR* pNMHDR, LRESULT* pResult)
{
CTest_Tab_Dialog myTestTab;
myTestTab.Create(IDD_PAGE_TestPage3, &m_cTab);
switch (m_cTab.GetCurSel())
{
case 0:
MessageBox("Tab 1 is selected!");
myTestTab.ShowWindow(SW_SHOW);
break;
}
Now, when changing the tab control to this nasty Test Tab 1, the program has to stop (waiting for the MessagaBox to be closed) and - like magic - I can finally see my stupid test tab dialog (IDD_PAGE_TestPage3 .
However, as soon as I OK the MessageBox, the content of the tab disapppears again. I assume it gets overwritten again by the tab contrl itself.
Any idea? ... I think we are almost there
|
|
|
|
|
To zero in on the problem, I would suggest you create a new workspace with only a tab and the dialogs to show on it. And get it right here before moving it into your main workspace.
«_Superman_»
|
|
|
|
|
I have done exactly that.
I am trying all this with a pretty clean workspace.
In fact I only ran the appwizard to create a dialog box based frame and all I have on the main window, is this Tab Control, which I want to display the dialog, just as per the snippets of code that I have posted.
There is nothing else than just the frame that the appwizard has created.
So if you want to give it a go, it would be very quick and easy to come to the same point.
Any other ideas/hints?
Do you think it is the right thing to create the object in the ONSELCHANGE function?
I mean I tried it in the OnInitDialog(), but the compiler didn't like it.
What else can I try... crazy this can't be so difficult. How many thousands of applications are out there that use something like this.
Please help
|
|
|
|
|
Hello out there, ... I just thought I post a last message to this case to let anyone who ever happens to read this thread by accident (or intention) know, that I have now managed to get things going.
My child dialogs are now working (almost) perfectly as contents of the individual pages of a tab control. Just some cosmetics that I have to tidy up.
While getting more and more frustrated, that I couldn't get something simple like a tab control going the way I wanted, I almost gave up.
The ultimate break-through was not until I came across the article from Andrew Lawrence ("Tabbed Dialog without Property Sheets"). I found this article just fabulous!!! It answered my question a hundred percent, and - while studying it - I learnt heaps more.
For the beginner of VC++ this is a highly recommended article!!!
I would like to take the opportunity to thank Andrew very much.
Many thanks also to you Superman for your patience and attempt to help. You were on the right track with your advice, but my ignorance about basic concepts prevented me from actually putting things right.
Keep up the good work
|
|
|
|
|
Read this[^] for starters.
p.s: something you should pay attention to, be sure to override the OnOK and OnCancel (or whatever you want to hook WM_COMMAND with IDOK and IDCANCEL to) methods otherwise when the user hits ENTER ot ESC while the focus is in one of your child-dialogs, the dialog will disappear...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
|
Hi,
Is there any machenism using Shell or anything else to calculate the size of a folder?
|
|
|
|
|
|
Is there any API like when window context menu propprty method?
As windows calculates size very fast, there should be any API like this.
|
|
|
|
|
MPTP wrote: there should be any API like this.
Not in my information. There needs to be a class(article) for this requirement. So you should understand there is no such API.
MPTP wrote: As windows calculates size very fast
Have you tried class in given link ? Isn't that fast ?
|
|
|
|
|
prasad_som wrote: Not in my information.
You are right. I checked the call stack using process explorer while the size is been updated in the property sheet. It is using some function called SizeThreadProc() in the shell32.dll . May be if we can figure out the prototype of the funcion, it will be a nice hack.
|
|
|
|
|
Naveen wrote: SizeThreadProc()
Looks like callback function. Must be adding up size of individual file in folder structure.
|
|
|
|
|
hmmm...
BTW happy to see you back on codeproject. What happened in between?
|
|
|
|
|
Naveen wrote: BTW happy to see you back on codeproject.
Thanks ! And congrats for being awarded as MVP.
Naveen wrote: What happened in between?
Changed employer, Changed country and busy with work.
|
|
|
|
|
Hi All.
I want to convert .ost file to .pst file.
Just FYI, I am not looking for a any tool/executable i.e. oct2pst.exe to do the same, rather I am looking for some set of libraries for this implementation. If anyone can provide some pointers for the same, that will highly appreciated.
Also, if possible please provide some details regarding the file structure for these .exts.
Incase any information required, please let me know.
Thanks and Regards.
PanB
|
|
|
|
|
OST to PST Solution provides facility for user Convert OST File to PST Solution with the help of OST Recovery Tool. OST PST Solution can swiftly recover and restore all your important emails, contacts, task, calendar, Journals etc from OST file to PST file solution even after Exchange server crashed. more info-: http://www.osttopstconversion.us/
|
|
|
|
|
how to convert time_t variable to formatted date
eg The long value [12345678900] to dd/mm/yyyy hh:ss
vineesh
|
|
|
|
|
Use the localtime function to convert time_t to struct tm .
Then use string formatting to get the required format.
«_Superman_»
|
|
|
|
|
Check the sample code at the end of this [^]documentation.
|
|
|
|
|
|
|
I have modeless dialog is derived from CDHTMLDialog that is hosted in DLL linked to MFC statically.
the problem is that keys such as tab don't work.
I have read Google documentation
1. for class derived from CDialog the solution in kb233263 work
2. for class derived from CDHTMLDialog this solution does not work
3. regarding the solution kb175502 PreTranslateMessage(MSG* pMsg) is not called for the dialog class, so I don't understand what to do there
Thanks for any help
|
|
|
|
|
Hi All,
I need to change border color of dialog window in MFC.
Please help me..............
Thanks Regards,
Anitha
|
|
|
|