CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32
  1. #16
    Join Date
    May 2004
    Location
    Michigan, United States
    Posts
    457
    Quote Originally Posted by MrDoomMaster
    Here is how I understand it:

    Create a dialog >> Create the property sheet and center/size it inside of the dialog >> add dialog resources to each of the tab pages?
    No. You just need to create the pages in the dialog resource editor. You don't have to create the dialog that the pages will be housed in. The PropertySheet() function will automatically create a dialog, whose size will depend on the size of your largest page.

    Once PropertySheet() has been called, your application-defined callback function will handle its messages. Handle the WM_INITDIALOG message in this procedure and re-size it as necessary.
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  2. #17
    Join Date
    Jun 2004
    Location
    Philippines
    Posts
    31
    Mr. Bond,

    I tried to follow through your tutorial. When I compile the code, I got one ERROR:
    error C2065: 'PropSheet_HwndToIndex' : undeclared identifier

    Is 'PropSheet_HwndToIndex' declared somewhere else or what? Please help, I want to learn creating tab control this way.

  3. #18
    Join Date
    May 2004
    Location
    Michigan, United States
    Posts
    457
    Quote Originally Posted by jbp2004
    Mr. Bond,

    I tried to follow through your tutorial. When I compile the code, I got one ERROR:
    error C2065: 'PropSheet_HwndToIndex' : undeclared identifier

    Is 'PropSheet_HwndToIndex' declared somewhere else or what? Please help, I want to learn creating tab control this way.
    Yeah, in prsht.h. Be sure to include it:
    Code:
    Minimum DLL Version comctl32.dll version 5.80 or later 
    Header prsht.h 
    Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  4. #19
    Join Date
    Aug 2004
    Posts
    2
    I want to use an actual tab control, not property sheets, as the tab control is housed in my main dialog. I think this is what the original poster wanted too. Does anyone know how to use *tab controls*? The MSDN docs for them are messy.

    I've created my tab control, added the tabs, and have the dialogs I need to stick in it, but I can't find out how to actually display the dialogs inside the tab control. Any help would be greatly appreciated.

  5. #20
    Join Date
    Jun 2004
    Location
    Philippines
    Posts
    31
    Don_PhrostByte,

    I read your problem just this morning. We have the same problem but my problem was solve a few days ago. Now, let me try to help you.

    You said, I've created my tab control, added the tabs, and have the dialogs I need to stick in it, but I can't find out how to actually display the dialogs inside the tab control. Any help would be greatly appreciated.

    Well, the tutorial I wrote in about a day! starts from scratch (from making dialogs/windows using MSVC++ resource editor) It's up to you if you will go through the tutorial in its entirety or find the portion that will solve your problem.

    I have submitted a copy of this tutorial here in CODEGURU but since it is still pending, let me give you the copy that I have uploaded to my website, it's here
    I am inviting you to join GreenZap. It is just like PAYPAL but it is more rewarding! You get $25 when you join (FREE to sign up) AND you get rewarded also when someone opened an account using your GreenZap promo code! GreenZap is launching June 1st.

    Click here and PREREGISTER

    Have a break. Visit JonelsPlace

  6. #21
    Join Date
    May 2004
    Location
    Michigan, United States
    Posts
    457
    Quote Originally Posted by jbp2004
    I have submitted a copy of this tutorial here in CODEGURU but since it is still pending, let me give you the copy that I have uploaded to my website, it's here
    Great work, jbp. I've found a few things in your code that should be updated, though.

    For one, there's no need to handle the WM_DESTROY message when using a modal dialog box. EndDialog() in your WM_CLOSE handler takes care of the dialog cleanup. PostQuitMessage() is not needed since you're not creating a message loop (Windows creates it for you).

    You should return FALSE (as opposed to false) from your DlgProc.

    I'm not sure if you need to use so many global variables. For instance, nTab is declared as global, but is only used in DlgProc. Better to make it a static variable in DlgProc instead. hdc, nmptr, and tci are others. By the way, what is the use for hdc?

    Finally, you're destroying the windows you create before you create them. But you're not destroying them when your dialog box closes.

    All in all, great job!
    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

  7. #22
    Join Date
    Jun 2004
    Location
    Philippines
    Posts
    31
    Thank you for the corrections Mr. Bond, I can improve more!

    I have updated the article based on Mr. Bond's corrections.
    If you are looking for a tutorial on how to use tab control
    read my article here

    Thanks!
    Last edited by jbp2004; August 3rd, 2004 at 09:25 PM.
    I am inviting you to join GreenZap. It is just like PAYPAL but it is more rewarding! You get $25 when you join (FREE to sign up) AND you get rewarded also when someone opened an account using your GreenZap promo code! GreenZap is launching June 1st.

    Click here and PREREGISTER

    Have a break. Visit JonelsPlace

  8. #23
    Join Date
    Aug 2004
    Posts
    2
    Quote Originally Posted by jbp2004
    Thank you for the corrections Mr. Bond, I can improve more!

    I have updated the article based on Mr. Bond's corrections.
    If you are looking for a tutorial on how to use tab control
    read my article here

    Thanks!
    looks good, still has some quirks:

    TabProc should use a switch.
    Only one HWND is used at one time for the tab pages, but there are 3 variables. Make it use one.

    thanks though, it was a good refresher.

  9. #24
    Join Date
    Jan 2005
    Posts
    1

    Re: Need tutorial on Tab Controls in Windows API

    Quote Originally Posted by jbp2004
    Don_PhrostByte,

    I have submitted a copy of this tutorial here in CODEGURU but since it is still pending, let me give you the copy that I have uploaded to my website, it's here

    The link is dead and I have not succeeded in locating this tutorial in codeguru. Please point me to where this tutorial ended up? Thanks.

  10. #25
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652

    Re: Need tutorial on Tab Controls in Windows API

    Quote Originally Posted by jkoutavas
    The link is dead and I have not succeeded in locating this tutorial in codeguru. Please point me to where this tutorial ended up? Thanks.
    EasyWin32 Library

  11. #26
    Join Date
    Feb 2004
    Location
    Texas, USA
    Posts
    1,206

    Re: Need tutorial on Tab Controls in Windows API

    Wow I made a post that earned 3,500+ views

  12. #27
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Need tutorial on Tab Controls in Windows API

    You can see working sample of property sheet embedded in a window in this thread.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  13. #28
    Join Date
    Feb 2008
    Posts
    2

    Re: Need tutorial on Tab Controls in Windows API

    Could someone please post a zip file with the source code for this?

    I can get it to compile but when I run it the program exits immediately after briefly flickering a dialog window.

    Not sure if some of the code was left as an exercise to the student or what.

    I figure getting a response to this is a long shot as this thread is rather old.

    I previously used a tabbed dialog box to do this but I understand that using a property sheet should make saving the settings of all pages a snap which was previously very painful.

    Thanks

  14. #29
    Join Date
    Jan 2008
    Posts
    178

    Re: Need tutorial on Tab Controls in Windows API

    See MSDN samples instead.

  15. #30
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: Need tutorial on Tab Controls in Windows API

    Quote Originally Posted by HwHack
    I can get it to compile but when I run it the program exits immediately after briefly flickering a dialog window.
    Could you be more specific? What can you get to compile? Did you do a debug build and see what is a reason for an application to exit prematurely?
    Are you using Visual Studio? If yes, what version?
    Quote Originally Posted by fred100
    See MSDN samples instead.
    Could you please elaborate? What sample?
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured