• Advertisement

Archived

This topic is now archived and is closed to further replies.

Tab Control in MSVC++

This topic is 5999 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m having some problems to put a tab control in my main window. I''ve been programming in c++ for a while, but i''d never programmed for windows before... So I don''t know anything about MFC, just a little bit of WIN32(although MFC looks more pleasant)... anyway... I''m using the common controls library(commctrl.h) then. And I have to initialize this to work(right?): INITCOMMONCONTROLSEX lpInitCtrls; lpInitCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX); lpInitCtrls.dwICC = ICC_TAB_CLASSES; InitCommonControlsEx(&lpInitCtrls); This seems to work fine, and the compiler finds no errors... but when its linking, i got this errors messages: Linking... MainProg.obj : error LNK2001: unresolved external symbol __imp__InitCommonControlsEx@4 Debug/MainProg.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. MainProg.exe - 2 error(s), 0 warning(s) Can anoyone help me? I also tried with InitCommonControls(void); and got the same problem thanx Manfrio

Share this post


Link to post
Share on other sites
Advertisement
If you''re using MFC (ala Dialog/SDI/MDI), you don''t need to include/call anything to use a tab ctrl. The required steps are taken for you in "AfxCmn.h" which is included in "stdafx.h". If you are creating a dialog app, just drag and drop a tab ctrl into the dialog and... voila'' . You''ll find that using MFC to make applications is extremely simple( dare I say VB... ).


Zerapolis

"It''s only after you''ve lost everything that you''re free to do anything." Tyler Durden

Share this post


Link to post
Share on other sites
You need to link the comctl32.lib lirary with your exe. Go to Project->Settings->Link and add comctl32.lib to the list of *.libs already there.

Share this post


Link to post
Share on other sites

  • Advertisement