Solved

Dialog tabbed control won't show

Posted on 2000-03-22
5
226 Views
Last Modified: 2010-04-10
I have a win32 api dialog program (no MFC).  When i try to add a tabbed control from the toolbar onto the dialog using the resource editor and compile it, it gives me 0 warnings and 0 errors.  Yet the form doesn't show.  What can i do?  When i delete the tabbed control the form shows.
0
Comment
Question by:Markenstein
[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
  • 3
  • 2
5 Comments
 

Expert Comment

by:tkirby052098
ID: 2647545
Assuming that the "visible" box is checked in the tab control resource properties, then the most likely causes are...

1) you have not initialized the common controls dll properly

INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(icex);
icex.dwICC = ICC_TAB_CLASSES;
InitCommonControlsEx(&icex);

2) you have not inserted any tabs into the control. without this step you are trying to display an empty control, so you see nothing. use TabCtrl_InsertItem and/or TabCtrl_SetItem as needed to add tabs to the control.

does this help?
0
 

Author Comment

by:Markenstein
ID: 2651311
I get the following errors after i added the commctrl.h.

INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(icex);
icex.dwICC = ICC_TAB;
InitCommonControlsEx(&icex);

Main.obj : error LNK2001: unresolved external symbol __imp__InitCommonControlsEx@4
Debug/DlgApp.exe : fatal error LNK1120: 1 unresolved externals
0
 

Expert Comment

by:tkirby052098
ID: 2654672
Okay, you must be running an old version of the SDK (the extended function is not supported in your common controls .lib and .dll files).  Try
InitCommonControls(); instead (no arguments).  This should work every time.  What compiler and SDK are you using?
0
 

Author Comment

by:Markenstein
ID: 2655444
I'm using VC++ 6, i don't know what SDK i'm using...  How can i upgrade it?
0
 

Accepted Solution

by:
tkirby052098 earned 50 total points
ID: 2656011
The SDK that comes with vc6 should have the function we are looking for.  Did you include the comctl32.lib file in your link?  I use vc5, so you would add the file under Project->settings->Link tab->object/library modules. It is not included by default.
SDK upgrades...I think you can still download the Platform SDK from microsoft for free (it's huge and takes forever) or they will send you a CD for about $20. I got mine for free along with the 2000 beta. I'm not sure that you need this. Consult your vc6 docs to see which sdk you have.

No offense intended, but you sound like a novice, so I offer an explanation of what is happening:  In order for your tab control to display, your program must register the tab control class. This happens when you call the Init function and calling the function causes the dll to be loaded into your programs process memory. VC finds the code for the function during the link process by searching the lib files for the name of the function. So....if you don't tell vc the right lib files to search, it can't find the function, and the error happens. Before (when you were not calling the Init function), the dialog tried to display a window based on the tab control class, but that class was not registered, so nothing was displayed. QED.

Good luck!
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

729 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