Solved

C++ Win32 TabControl + Dialog (resources)

Posted on 2015-01-12
4
390 Views
Last Modified: 2016-11-10
Hello! How are you?

I'm trying to use resources but i found a problem.

I did a Dialog, added a tabcontrol, i want to use another dialog to display my controls in tab 1, so it's more easy to hide everything.

I'm doing this in the main callback dialog:

case WM_INITDIALOG:{
	MyControls::Instance().AddPageToTab(GetDlgItem(hWnd, IDC_TAB1), Main::Inst().items, "aaaaaaa", 0);
	MyControls::Instance().AddPageToTab(GetDlgItem(hWnd, IDC_TAB1), Main::Inst().items, "bbbbbbb", 1);
	MyControls::Instance().AddPageToTab(GetDlgItem(hWnd, IDC_TAB1), Main::Inst().items, "ccccccc", 2);
	TWin::Inst().hwnd = CreateDialog(NULL, MAKEINTRESOURCE(frmSecond), GetDlgItem(hWnd, IDC_TAB1), (DLGPROC)SecondProc);
	return TRUE;
	break;
}

Open in new window


screenshot about it
frmSecond = "IDD_FORMVIEW" type in visual studio.

IDC_TAB1 the tab control in resources.

What i need to do?

Ty!
0
Comment
Question by:Júlio
  • 2
4 Comments
 

Author Comment

by:Júlio
ID: 40546475
Idk if it is corret, but i'm setting the x,y position to fix it. But when i create it, it should be inside the tabcontrol, no?=(
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 500 total points
ID: 40546917
Hi dm0000,

IMO you have to move the child dialog to down/right because I think it overlaps the tabs of the tab control. And I think it's clear because for a tab control the client-rect equals the window-rect, so placing a child dialog on client coordinate 0, 0 causes it to be place at the top/left of the complete tab control.

I think (allthough I'm not sure coz I didn't test) you can use the TCM_GETITEMRECT message to ask the tab control about the rectangle you can use for the child dialog.

Hope that helps,

ZOPPO
0
 

Author Closing Comment

by:Júlio
ID: 40547223
Yes, i'm doing this. Ty!
0
 

Expert Comment

by:a a
ID: 41882396
me too this problem
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
canBalance challenge 34 85
How to gracefully close the c++ 11 thread? 3 95
Safe conversion? 4 67
Capture logon name 13 73
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question