[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

C++ Win32 TabControl + Dialog (resources)

Posted on 2015-01-12
4
Medium Priority
?
498 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 how to clear a vector as well as how to detect empty vectors in C++.

656 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