Type: Posts; User: 2kaud
Search took 0.09 seconds.
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...
Correct. terrain is a 2d array of type Terrain which is a struct.
Why is everything in the class Map public?
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...
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...
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 <=...
Yes, as an example consider
using namespace std;
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
June 30th, 2015, 05:17 PM
From your code snippet in post #1, you don't seem to be null terminating the returned string or obtaining the line index. Try
int nLineLength = 0;
June 30th, 2015, 01:37 PM
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...
June 30th, 2015, 12:53 PM
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
June 30th, 2015, 06:24 AM
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
June 29th, 2015, 03:15 PM
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...
June 29th, 2015, 01:33 PM
cout << setprecision(year) << fixed;
This doesn't seem right to set the precision to the number of years to print??
June 29th, 2015, 11:41 AM
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...
June 29th, 2015, 11:29 AM
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/
June 29th, 2015, 08:51 AM
What compiler are you using?
is not recommended as 0 is being taken to be the memory location of the start of a c-style string. Just use
June 29th, 2015, 08:39 AM
As the code is using property sheets, this link may be of interest
June 29th, 2015, 08:33 AM
How are you handling the WM_PRINTCLIENT message? See https://msdn.microsoft.com/en-us/library/dd145217%28v=vs.85%29.aspx
June 28th, 2015, 03:49 PM
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...
June 27th, 2015, 08:58 AM
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.
June 26th, 2015, 02:55 AM
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...
June 25th, 2015, 03:51 PM
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!
June 25th, 2015, 03:36 PM
June 25th, 2015, 03:32 PM
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 ???
June 25th, 2015, 03:12 PM
It didn't on my system. It showed 0 rather than the expected 9!
Click Here to Expand Forum to Full Width