|
thread handle bank also does have limit only we can increase the limit
|
|
|
|
|
Rajkumar R wrote: HANDLE is a 32 bit value, then 2 power 32 is the limit as each thread is represented by a HANDLE
Thread HANDLEs and many other kernel object HANDLEs are always a multiple of 4 because the last two bits of the HANDLE are always zero. The last two low order bits can be used as TAG bits.
Best Wishes,
-David Delaune
|
|
|
|
|
so it is even less 2 power 30
|
|
|
|
|
One thread per processor is all the threads that can run at a given point of time.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It is not valid for HT (Hyper threading) machine, one processor multiple execution chain
|
|
|
|
|
Fine...I'll include logical processors in the list of processors
as well
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I wonder why the plus sign + and the vertical lines which indicate the hierarchy of the tree control don't get displayed in my dialog and only the texts and images are displayed in a hierarchical tree.
Thanks in advance.
Pan
Toe the line
Thread the needle
Think outside of the box
|
|
|
|
|
check whether u have set these treecontrol styles TVS_HASBUTTONS and TVS_HASLINES
|
|
|
|
|
You got me
Thanks
Toe the line
Thread the needle
Think outside of the box
|
|
|
|
|
Hi
What would be the best way to convert a CString value of say "C-YOu01"
to a numerical value ?
i thought of using atoi, however this returns 0
Any idea would be much appreciated
Simon
|
|
|
|
|
si_69 wrote: C-YOu01
si_69 wrote: however this returns 0
Well, what did you expect ? If you asked me to convert that string into a numeric value, I would say that I can't. Your computer did the same. How do you convert that into a number ??
|
|
|
|
|
Cedric Moonen wrote: Well, what did you expect ? If you asked me to convert that string into a numeric value, I would say that I can't.
Because you're not able to work with base 128 .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
I wonder and willing to know any number system which has its string representation that contain the characters like (C, -, Y) other than A-F.
|
|
|
|
|
Any numeric system you want can actually have that representation. We only use A-F in hexa cause it makes it easier to have a human readable representation based on decimal, sort of. But when you want a random numeric base and want to represent it visually you use what's easier, character codes (1 character visual, making it easier to link it to a single digit, rather than the 1658th digit and numeric representation for the computer).
But yeah, for the OPs request, that would certainly return 0.
|
|
|
|
|
Well, symbols A-F of hexadecimal base system have nothing special. You can use N distinct symbols (as well an ordering criterion) to represent digits in a N -base numeric system. For instance you can use, though it is unpractical, the {ON,OFF} pair as digits for the binary system.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
nice talking to u and Dex
|
|
|
|
|
si_69 wrote: What would be the best way to convert a CString value of say "C-YOu01"
What is your desired output for the above string? Numeric value 1? (because 01 is 1)
Your solution has to be simple, but then that would depend on how the string will look like (no. of digits and the pattern in which they appear in the string). If you are clear on that part, you can easily write a solution.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
si_69 wrote: What would be the best way to convert a CString value of say "C-YOu01"
to a numerical value ?
Something like:
std::string str = "C-YOu01";
int nVal = 0;
for (int x = 0; x < str.length(); x++)
{
int c = str[x] - 48;
nVal += c;
}
std::cout << nVal << std::endl;
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Got the point. Hence
int nVal;
nVal = strlen("C-YOu01");
printf("%d\n");
is a valid alternative?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Well, since you're just summing up character codes, I assumed you was driven by the broad requirement of returning a number from the string, that way my own piece of code is a valid alternative.
(i.e. I was kidding)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hello board,
There is a function that checks if a pointer is in valid memory space in MFC, I have used that before but now I forgot that and MSDN help is so crap and stupid that despite that I've tried many keywords it returns completely unrelated subject. No wonder MSN never can match google.
Can anybody give me the name of that function, please to check validity of a pointer.
Also is there any function that checks validity of a handle. When I use CloseHandle, in debug mode sometimes an exception occurs that says handle value is invalid. while I usually define handle value as INVALID_HANDLE_VALUE in the beginning and my expression is
<br />
if(m_hHandle != INVALID_HANDLE_VALUE)<br />
CloseHandle(m_hHandle);<br />
but exception occurs and the value of handle is other than
INVALID_HANDLE_VALUE
Thanks and have a nice day.
|
|
|
|
|
Why do you need such a function ? A much easier (and cleaner) solution is simply to set the pointer to NULL when you destroyed it. Then you simply check if it is NULL or not. Same with the HANDLE.
|
|
|
|
|
|
And what's the difference with what I suggested (meaning setting your pointer to NULL when you deleted it) ?
|
|
|
|