|
NewbieStats wrote:
GetDlgItemText into single CHAR allowing me to change them?Is it possible to break down a String into single Characters?
Look for CString::GetAt()
NewbieStats wrote:
regroup them back together? Is it possible to break down a String into single Characters?
look at CString::SetAt() ,But beware in this allocate a empty buffer to CString before using CString::SetAt() function
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
Would it be Easier to do that or use;
strPassword.SetSel(0,1); // ++
Copy and Paste to New CString and Add all CStrings together?...
Seems like a long process, but would it be better?
/* Just a Human Trying to Live in a Computers World. */
|
|
|
|
|
|
Okay thanks ill try them both and see which one seems to fit better
/* Just a Human Trying to Live in a Computers World. */
|
|
|
|
|
Hi
I have developed one Multithreading application in C++, which runs on Windows 2000 Professional OS, in which I want to create some 10,000 thread. Is it possible to create these many threads ?
Is there any restriction on how many number of threads can we carete ?
How can I achieve this goal ?
Any suggestion plz...
Thankx a lot
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Why don't you create test application which create 10000 thread!.
as far as I Know MSWord use 1446 threads and Internet Explorer use 1006 thread!!!
PS: these statics may be wrong,as i don't know where i read about this.
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
ThatsAlok wrote:
as far as I Know MSWord use 1446 threads and Internet Explorer use 1006 thread!!!
I'm not sure where you got these numbers, but I've never seen either application use more than a dozen or so each.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
I'm not sure where you got these numbers, but I've never seen either application use more than a dozen or so each.
I remember only one thing I loast computer quiz by not answering this question.really i am no written literature or documentation to comment on above statement
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
As with the above reply, windows does have finite resources and as such does have a maximum limit on the number of threads that it can have. You can do a quick search online in MSDN, but I can bet that it is a lot less .
Personally I think that even thinking of creating 10k threads is a sign of lunacy! , so let us know what you are trying to achieve using your multithreaded app, and we'll do our best to find a more reasonable alternative design.
I Dream of Absolute Zero
|
|
|
|
|
Hi RChin,
Thanks a lot to reply me, and be glad that u show interest.
I m developing a Windows service that is going to monitor something around 5000 mailboxes and my requirement is such that i want to get new mails as it appears in any of mail box with minimum time delay.
Any design or coding suggestions will be highly appreciated.
Thanks in advance.
Mahesh.
|
|
|
|
|
The need for so many threads is an indication of a design flaw. While it may be possible (I do not know the maximum count), switching between the threads, or even searching the list of threads, will have a serious impact on performance. Remember that a multi-threaded application, unless run on a multiprocessor machine, can be slower than its single-threaded counterpart simply because of all the context switching that must go on.
See here, here, and here.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Could someone help to explain this statement in c below:
void (*fixup_irq)(struct pci_controller *, pci_dev_t);
Question 1 : Why can it put "viod" in this statement since this is not a method?
Question 2 : Why can it put "(*fixup_irq)" as cast method here?
Thanks a lot!
|
|
|
|
|
Looks like a function pointer to me.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
this is not a cast!
fixup_irq is a function pointer.
you can assign any function to it that has return type void and exactly the
same parameters in its parameterlist
if you got somewhere a func defined as:
void AMethod( struct pci_controller* par1, pci_dev_t par2)
{
...
}
then you can do the following
//assign a method to fixup_irq
fixup_irq = &AMethod;
pci_controller var1; //for the 1st parameter
pci_dev_t var2; //for the 2nd parameter
.... //do some stuff
//and here you call AMethod using the function pointer
(*fixup_irq)(var1, var2); //this is equivalent to calling AMethod( var1,var2);
This is in a fast draft what it means... Hopes this clears it up for you somehow? It doesn´t really show in this example but function pointers can be a real help in some situations.
Cheers,
Davy
|
|
|
|
|
GDavy wrote:
It doesn´t really show in this example but function pointers can be a real help in some situations.
To complete the response from Davy, this is used when you dynamically load functions from a dll. You load your dll, then it returns a handle and with this handle you can call an API function that will return a void pointer to a function in the dll (providing it's name).
So, you will need to store this pointer somewhere and it's here that these kind of things enter.
|
|
|
|
|
I got it finally. Thanks a lot!
|
|
|
|
|
Hi All!!!
I Had A strange requirement regarding RichEditCtrl.
I need to Limit the TextLength(Max Charecters) in Each Line of Richeditctrl to 50.In addition to that i need to insert spaces after every 10 charecters in each line.so in each Line Altogether 5 spaces will be there.
In case if user added,deleted,modified charecters the alignment with spaces should not change..this is my requirement.I tried USing LineLength but notreaching my requirement.
Thanks
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
In that case, you need to store all the characters that aren't spaces, and ignore spaces altogether. Then you need when you display your text to insert the spaces where you need them. There's no point having them as part of the underlying string, if they have to always be there, it's actually a display issue, not an issue of the string value.
I guess the best way to do that is to derive a class from the RichEditControl.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
suppose i have a map<string,int> m;
if i need to search for the location using the int data im currently doing
map<string,int>::iterator iter;
for(iter=m.begin(); iter !=m.end(); iter++)
{
if(iter->second == 10)
break;
}
can i replace this with something like this
iter = find_if(m.begin(),m.end(),bind2nd(KeyEquals(),10));
in which case what would the KeyEquals function object be like???
|
|
|
|
|
fordge wrote:
suppose i have a map m;
if i need to search for the location using the int data im currently doing
map::iterator iter;
for(iter=m.begin(); iter !=m.end(); iter++)
{
if(iter->second == 10)
break;
}
can i replace this with something like this
iter = find_if(m.begin(),m.end(),bind2nd(KeyEquals(),10));
in which case what would the KeyEquals function object be like???
Sure you can in some way. But why would you want to do this? You have a simple, maintainable solution. Why replace it with a geek-style, Boost-ish hack?
|
|
|
|
|
in this case it may be geekish yes..but i still find it more readable
but there may be more generic adapters where it would be better to use something other than that while loop
also most of the bind1st n bind2nd articles deal only with vectors
and was finding it hard to reproduce the same on maps and sets
anyway here is the solution i got from a fellow coder
typedef std::map MyMap;
bool KeyEquals(MyMap::value_type value, int DataValue)
{
return value.second == DataValue;
}
std::string blah(MyMap const& theMap, int thing)
{
MyMap::const_iterator it =
std::find_if(theMap.begin(), theMap.end(),
std::bind2nd(std::ptr_fun(KeyEquals), thing));
return (it==theMap.end())?std::string():it->second;
}
|
|
|
|
|
say i have a data that i should be able to lookup using EITHER a int key or a string key..i repeat EITHER..
what kind of container should i be using
|
|
|
|
|
<a href = "http://www.boost.org/libs/multi_index/doc/index.html" rel="nofollow">boost::multi_index_container</a>[<a href = "http://www.boost.org/libs/multi_index/doc/index.html" target = "_blank" rel="nofollow">^</a>]
|
|
|
|
|
markkuk wrote:
boost::multi_index_container[^]
... and tell us if you get it started
|
|
|
|
|
Currently created a dialog-based project and then populate it with Text Box controls. My problem is that the dialog stops accepting controls when the total number of control is 255. Is there a way to increase the number of controls beyond 255? Already tried putting edit, group box, etc. but still is limited to 255 maximum.
|
|
|
|