Solved

Dialog tabbed control won't show

Posted on 2000-03-22
5
213 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now