A service runs in the background, so where are these WM_COMMAND's coming from? You won;t have a menu, or a dialog box...
I think you need to go back to your basics - a service communicates with other programs using various interprocess communcations.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
No, you are writing all your strings into one string, so you will keep only the last one. The problem you have is that you don't know upfront how many directories you will get, so you don't know how large you have to make your array. You could choose the brute force and use an array which is large enough (e.g. char array: max 1024 directories of max 1024 characters). And then in your while loop you keep an index of where to store the current directory name (simply increment it each time).
Is it a C or C++ project ? Because if it is C++, I strongly suggest you to use stl containers (std::list for instance) and std::string, this will avoid to create an array with a fixed size upfront.
unsigned long i; //4-bytes, int: 4-bytesshort s; //2-bytes
signed char c; //1-byte
i = (s<<15) + (c <<9);
How will type conversion take place in this case?
Is it that:
1. s will remain short(2 bytes) thus shifting the LSB into the MSB and remaining bits turn 0; c is promoted to short then left-shift 9 performed. The final R-value is promoted to unsigned long and saved into i.
2. s and c both get converted to unsigned long before performing the shift operation (thus we do not lose any of the left-shifted bits)
or something else happens.
I tried it in VS6.0 and the result seem to indicate that in both s and c I did not lose any bit upon left-shifting as if s and c acted as if they were a 4-byte data type (long or int)
All shifts take place in a register.
The registers are 32-bit in a 32-bit OS.
So even though the shift overflows the variable, it will still remain in the register.
That's the reason you don't loose any bits.
«_Superman_» I love work. It gives me something to do between weekends.
I understand that the shifts take place in registers but then the evaluated values have to be stored back into their respective variables, which are of type short and char, which cannot hold 4-byte values.