dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15

Thread: Coding Question

  1. #1
    Join Date
    May 2010
    Posts
    3

    Coding Question

    I am not familiar with the code so much. Can anyone look at the artist, album, and song controls and advise me what numbers could be changed to allow the text fields to allow more characters?

    Here is the code.


    100 DIALOG 66, 50, 451, 244
    STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
    CAPTION "Title"
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    FONT 8, "MS Sans Serif"
    {
    CONTROL "About", 1000, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 5, 225, 50, 13
    CONTROL "Config", 1001, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 60, 225, 50, 13
    CONTROL "Directory", 1003, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 115, 225, 50, 13
    CONTROL "Rename", 1004, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 170, 225, 50, 13
    CONTROL "Playlist", 1005, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 225, 225, 50, 13
    CONTROL "Remove Tag", 1006, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 280, 225, 50, 13
    CONTROL "Update Tag", 1002, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 335, 225, 50, 13
    CONTROL "Done", 2, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 390, 225, 50, 13
    CONTROL "List1", 1019, "SysListView32", LVS_REPORT | LVS_SHOWSELALWAYS | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 5, 24, 435, 130
    CONTROL "", 1009, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 10, 175, 130, 13
    CONTROL "", 1018, EDIT, ES_LEFT | ES_AUTOHSCROLL | ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 155, 175, 40, 13
    CONTROL "", 1015, EDIT, ES_LEFT | ES_AUTOHSCROLL | ES_NUMBER | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 220, 175, 65, 13
    CONTROL "", 1016, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 300, 175, 125, 13
    CONTROL "", 1014, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 10, 200, 130, 13
    CONTROL "", 1008, EDIT, ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 155, 200, 130, 13
    CONTROL "", 1017, COMBOBOX, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 300, 200, 125, 160
    CONTROL "L", 1022, BUTTON, BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 140, 175, 10, 13
    CONTROL "L", 1038, BUTTON, BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 195, 175, 10, 13
    CONTROL "L", 1028, BUTTON, BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 285, 175, 10, 13
    CONTROL "L", 1029, BUTTON, BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 425, 175, 10, 13
    CONTROL "L", 1024, BUTTON, BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 140, 200, 10, 13
    CONTROL "L", 1027, BUTTON, BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 285, 200, 10, 13
    CONTROL "L", 1030, BUTTON, BS_AUTOCHECKBOX | BS_PUSHLIKE | BS_FLAT | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 425, 200, 10, 13
    CONTROL "Status...", 1010, STATIC, SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 10, 9, 365, 8
    CONTROL "0", 1012, STATIC, SS_RIGHT | WS_CHILD | WS_VISIBLE | WS_GROUP, 380, 9, 55, 8
    CONTROL "Status", 1007, BUTTON, BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 5, 0, 435, 20
    CONTROL "Tag Contents", 1026, BUTTON, BS_GROUPBOX | WS_CHILD | WS_VISIBLE, 5, 155, 435, 65
    CONTROL "Artist", 1031, STATIC, SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE | WS_GROUP, 10, 165, 35, 8
    CONTROL "Album", 1032, STATIC, SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE | WS_GROUP, 10, 190, 35, 8
    CONTROL "Song", 1033, STATIC, SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE | WS_GROUP, 155, 190, 35, 8
    CONTROL "Year", 1034, STATIC, SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE | WS_GROUP, 220, 165, 35, 8
    CONTROL "Comment", 1035, STATIC, SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE | WS_GROUP, 300, 165, 35, 8
    CONTROL "Genre", 1036, STATIC, SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE | WS_GROUP, 300, 190, 35, 8
    CONTROL "Track", 1037, STATIC, SS_LEFTNOWORDWRAP | SS_CENTERIMAGE | WS_CHILD | WS_VISIBLE | WS_GROUP, 155, 165, 35, 8

  2. #2
    Join Date
    Apr 2010
    Location
    Western WA, USA
    Posts
    59

    Re: Coding Question

    The last two numbers in each control definition are the width and height. So if you made the width larger, you could contain more text, but there might be problems with overlapping controls.

    You would do better to make modifications in a resource editor that simulates the dialog and its controls, to make sure the placement isn't all screwed up.

  3. #3
    Join Date
    May 2010
    Posts
    3

    Re: Coding Question

    What is your recomendation for a good resource editor falling into the freeware categy?

  4. #4
    Join Date
    Apr 2010
    Location
    Western WA, USA
    Posts
    59

    Re: Coding Question

    I don't know about freeware resource editors. Since you are posting in the Visual C++ area, I'd assume you would use the one built into Visual Studio.
    Attached Images Attached Images  
    Last edited by cosmicvoid; May 22nd, 2010 at 02:37 AM.

  5. #5
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Coding Question

    The OP may be using an Express version of VS which, I believe, has no resource editor.

  6. #6
    Join Date
    Nov 2003
    Posts
    1,902

  7. #7
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: Coding Question

    Quote Originally Posted by Codeplug View Post
    This is a more complete package

  8. #8
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Coding Question

    Quote Originally Posted by Codeplug View Post
    Wow. I wonder who had the bright idea of co-opting the name of an old Mac OS 9 Resource Fork Editor program for a task only applicable to Windows. Talk about mis-using name recognition.

  9. #9
    Join Date
    Jun 2006
    Posts
    645

    Re: Coding Question

    I really extend my sympathies to all the C++ developers including me, as for not having a free resource editor provided along with MS VC++ express and standard editions. What is the point in not providing it to the developers, is beyond me. Version after version, Microsoft is releasing VC++ along with other products in Visual Studio, but with out any path breaking development in it since 2005. After 1998, I believe, it was 2005 version that was a better one and following which, in 2008 and 2010 they have done nothing but improve looks and provide key bug fixes. Providing a free resource editor is one thing they could have done for sure....
    Thanks,
    Bhushan

  10. #10
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Coding Question

    I'd say 2010's support for C++1x has been a massive step forward. And they don't even support the entire standard yet (I'm waiting on standard threads, personally).

  11. #11
    Join Date
    Jun 2008
    Posts
    592

    Re: Coding Question

    still gcc has more support for c++1x and it is still missing enough http://gcc.gnu.org/projects/cxx0x.html , but they did support c++1x much sooner than msvc c++ compiler did. roughly a year.

    I am still waiting for more c++1x in gcc .. but the first to come in mind is:

    1. Range-based for
    2. non-static member initialization
    0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
    0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000
    0000 0000 0000 0000

  12. #12
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Coding Question

    I'm surprised gcc doesn't have range-based for yet. That seems like it would be relatively easy to implement.

    Ah well, there's still BOOST_FOREACH.

  13. #13
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,248

    Re: Coding Question

    Quote Originally Posted by bhushan1980 View Post
    I really extend my sympathies to all the C++ developers including me, as for not having a free resource editor provided along with MS VC++ express and standard editions.
    Not having free software has never bothered me. I consider it my responsibility as a software professional to spend the money on any software I need to do my job. Full Visual Studio versions aren't that expensive and upgrades are even cheaper. I've always thought it worth it to spend a few dollars and stay current. Of course, that's strictly my opinion.

  14. #14
    Join Date
    May 2010
    Posts
    3

    Re: Coding Question

    Quote Originally Posted by cosmicvoid View Post
    The last two numbers in each control definition are the width and height. So if you made the width larger, you could contain more text, but there might be problems with overlapping controls.

    You would do better to make modifications in a resource editor that simulates the dialog and its controls, to make sure the placement isn't all screwed up.
    Like I said I am o programmer. I noticed the character limit for album, artist, and song is 30. How do I expand that to 45?

    I thought the 35 and 8 numbers you spoke of truly represented the number of characters. Appreciate the help.

  15. #15
    Join Date
    Apr 2010
    Location
    Western WA, USA
    Posts
    59

    Re: Coding Question

    Quote Originally Posted by jshollis View Post
    ... I noticed the character limit for album, artist, and song is 30. How do I expand that to 45?.
    You might could do that by sending the control a EM_SETLIMITTEXT message with the value 45, but that is a bad tactic, as the code that gets the text from the control will not expect more than 30 chars, so you could have a buffer overflow and crash the program.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)