It was not a problem before, because the compiler did things that were not standard. But starting with Visual Studio 2005, the scope of the variables does not exceed the block they are defined in. And that applies to for loops too. So you either declare the index variable before the first for loop, or re-declare it in each for statement.
As for the other problem, it's also an error with the old compiler. Your actual handler should return LRESULT, not void. So change the function to the requested signature (take a WPARAM and LPARAM and return LRESULT) and everything will be OK.
BTW, there is no such thing as VS2006. There is VS2002, VS2003, VS2005 and VS2008.
I use the CImage::Load() to load a png file,
and then use SetBitmap() to set this image to Picture Control.
I had define a CStatic member and use DDX_Control to bind this CStatic object to Picture Control. But when CDialog startup, no image shows.
There is a similiar issule about Picture Control. I use the Picture Control to display different button images. When mouse in different area of Picture Control, this control wil display a different image,
I had a initialized operator for this Picture Control, but why only after I use mouse to move in the Picture Control, then this image will show. I do not know any other code needed to written. After SubClassDlgItem().
i have a funktion to count files in a directory and its subdirectory, but how to count a ADS files, alternate da ta stream?
How to pas a path to FindFile() and FindNextFile() ??
I try to make a path from a visible file like:
"C:\visible.txt" to "C:\visible.txt:*.*" but this is not correct.
Does any one knows how to do this?
You must always escape the special characters, such as backslash, in string constants in C/C++, by prefixing them with the escape character, which is a backslash. In your example you are escaping the first character (v) of the word visible.
One of these days I'm going to think of a really clever signature.
in this example i need a WDK installed, is this right?
Because VS 10 don't know a "NtQueryInformationFile" and i found on microsoft.com that i need "ntifs.h" to include for this? After all ntifs.h is on my system but now i can't find "windowsfamiliy.h"
I have a C++ Windows application using Win32 API's. User can select a control (buttons, text box, drop down...) via using the TAB button on the key board. By default Windows does a drawing by which the selected control looks selected, but is it possible to make it more visible by a color change?
i.e., when the user selects a BUTTON can i make the color of the button change to blue or orange or something like that, thus giving a visual feeling that this is the control that's selected.
BTW, this is a Win32 API app, so which windows messages i need to check for this and make changes?
There is a class A, in a outside library. Now I want to use the way of explicit load librar. I know that it needs to use LoadLibrary to load the dll and use the function GetProcAddress to get the function pointer if use outside function. But how to use the outside class.