Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: 2kaud

Page 1 of 80 1 2 3 4

Search: Search took 0.09 seconds.

  1. Replies
    9
    Views
    113

    Re: Selection in listbox or combobox

    If you want to associate a numeric ID with each item in the list box, then this can be done using the LB_SETITEMDATA and LB_GETITEMDATA messages. See Messages to List Boxes in...
  2. Replies
    9
    Views
    113

    Re: Selection in listbox or combobox

    Correct. terrain is a 2d array of type Terrain which is a struct.

    Why is everything in the class Map public?
  3. Replies
    12
    Views
    189

    Re: Add string to combo box

    Although simple, the problem with this method is that it assumes that the various IDC_T_UCLASSxxx values will always be 10 apart. They may be so now but there is no guarantee that if the resource...
  4. Replies
    12
    Views
    189

    Re: Add string to combo box

    to_string() is a c++11 feature which isn't supported in VS 2010.

    Looking at your code in post #1, Lcombo_fill() seems to take an int as the second parameter - so IDC_T_UCLASS1 must be a number...
  5. Replies
    12
    Views
    189

    Re: Add string to combo box

    What compiler are you using as the code excerpt in my post #7 compiles ok using MS VS 2013. Try changing size_t to int. If that doesn't work with your compiler then try


    for (int c = 1; c <=...
  6. Replies
    1
    Views
    85

    Re: a question regarding to std vector

    Yes, as an example consider



    #include <vector>
    #include <string>
    #include <iostream>
    #include <algorithm>
    using namespace std;
  7. Replies
    12
    Views
    189

    Re: Add string to combo box

    IDC_T_UCLASS1, IDC_T_UCLASS2 etc are macros which are expanded by the pre-processor before the code is compiled. Hence you can't do what you want to do in your post #6. However, consider


    #define...
  8. Replies
    4
    Views
    229

    Re: Word break in a richedit box

    From your code snippet in post #1, you don't seem to be null terminating the returned string or obtaining the line index. Try


    CString Line1;
    int nLineLength = 0;

    nLineLength =...
  9. Replies
    21
    Views
    347

    Re: On click tab event

    You already are with PSN_SETACTIVE/PSN_KILLACTIVE. See https://msdn.microsoft.com/en-us/library/windows/desktop/bb774568%28v=vs.85%29.aspx

    The PSN_SETACTIVE notification is sent when a page is...
  10. Replies
    21
    Views
    347

    Re: On click tab event

    sheet = (HWND)PropertySheet(&header);


    Note that PropertySheet() does not return a HWND but a status value. See https://msdn.microsoft.com/en-us/library/windows/desktop/bb760811%28v=vs.85%29.aspx
  11. Replies
    7
    Views
    202

    Re: Savings Calculator Help!

    You are missing a #include for the string class.



    cout << balance = principal *pow(rate, year);


    This is not valid. As you are displaying the value of balance in the next statement, try
  12. Replies
    12
    Views
    217

    Re: A question regarding protected member

    foo() is a protected member function of class B so can only be accessed from with B and its children. In main() you are trying to access Class B foo from outside a class which can't be done for a...
  13. Replies
    7
    Views
    202

    Re: Savings Calculator Help!

    cout << setprecision(year) << fixed;


    This doesn't seem right to set the precision to the number of years to print??
  14. Replies
    7
    Views
    202

    Re: Savings Calculator Help!

    When posting code, please use code tags. Go Advanced, select the formatted code and click '#.

    and your question regarding the code is??

    You have an issue concerning the use of variable year. If...
  15. Replies
    7
    Views
    174

    Re: std::vector with negative subscript?

    As vector uses random access iterators, you can add or subtract a number to a vector iterator if the resulting iterator is not out of bounds. See http://www.cplusplus.com/reference/iterator/

    So if...
  16. Thread: Getline error

    by 2kaud
    Replies
    8
    Views
    303

    Re: Getline error

    What compiler are you using?

    However


    string code(0);

    is not recommended as 0 is being taken to be the memory location of the start of a c-style string. Just use
  17. Replies
    21
    Views
    347

    Re: On click tab event

    As the code is using property sheets, this link may be of interest
    https://msdn.microsoft.com/en-us/library/windows/desktop/bb774538%28v=vs.85%29.aspx
  18. Replies
    8
    Views
    230

    Re: MFC PrintWindow() only works sometimes

    How are you handling the WM_PRINTCLIENT message? See https://msdn.microsoft.com/en-us/library/dd145217%28v=vs.85%29.aspx
  19. Thread: Getline error

    by 2kaud
    Replies
    8
    Views
    303

    Re: Getline error

    If you get a new error then it's not working!

    You haven't posted you revised code so we don't really know the source of the error. However, if you have just changed the type of code then your code...
  20. Re: win32 - THEME: how can i draw a diferente visual styles with controls?

    Again, MSDN is your friend here. Do some searches for example Round Rectangle, linear gradient brush etc and you'll find plenty of info and examples.
  21. Thread: Getline error

    by 2kaud
    Replies
    8
    Views
    303

    Re: Getline error

    Welcome to c++ :wave:

    First, when posting code please use code tags. Go Advanced, select the formatted code and then click '#'.

    code is of type vector<char>. There is no overloaded function...
  22. Re: Challange for you becomes a challenge for others! Help creating a code snippet:

    A 'variation on a theme' is this version which contains the same bug but on my system (windows 7) displays what is expected and doesn't cause an exception! So the program is right, right!


    ...
  23. Re: Challange for you becomes a challenge for others! Help creating a code snippet:

    Definitely! :thumb:
  24. Re: Challange for you becomes a challenge for others! Help creating a code snippet:

    Why? Accessing the vector via an out-of-bounds iterator is undefined behaviour. It may cause an exception, or it may just overwrite memory (buffer overflow) or ???
  25. Re: Challange for you becomes a challenge for others! Help creating a code snippet:

    It didn't on my system. It showed 0 rather than the expected 9!
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




HTML5 Development Center