Dialog tabbed control won't show

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.
MarkensteinAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
tkirby052098Connect With a Mentor Commented:
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
 
tkirby052098Commented:
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
 
MarkensteinAuthor Commented:
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
 
tkirby052098Commented:
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
 
MarkensteinAuthor Commented:
I'm using VC++ 6, i don't know what SDK i'm using...  How can i upgrade it?
0
All Courses

From novice to tech pro — start learning today.