|
what this error means?
#include "strutil.h" No such file or directory
|
|
|
|
|
It means the file strutil.h does not exist in the location you told the compiler to look for it.
led mike
|
|
|
|
|
how look for it
modified on Friday, June 27, 2008 1:11 PM
|
|
|
|
|
What about the documentation [^]?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
You can search for this file on your computer.
|
|
|
|
|
I would like to write an exchange add-in that will process messages before they are delivered to user mailboxes. Can someone tell me if this is possible and, if it is, tell me the name of the add-in technology so I can search for some examples. I'm getting nowhere fast guessing?
|
|
|
|
|
|
Hi,
Can any once help me in removing the tab spaces using c++ source.
I am reading a text file line by line and i am able to remove all the spaces, but i am unable to reomve the tab spaces.
Thanks,
Nandu
|
|
|
|
|
Removing '\t' character should be similar to removing ' ' one.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Even i tried with '\t', but still i am facing the same problem.
string removeSpaces( string & str )
{
std::string::iterator to = str.begin();
std::string::iterator from;
for( from = str.begin(); '\0' != *from; ++ from )
{
if ( (' ' != *from ) || ('\t' != *from))
*(to ++) = *from;
}
if( *to != '\0' )
str.erase(to, from);
*to = '\0';
return str;
}
|
|
|
|
|
Nandu_77b wrote: if ( (' ' != *from ) || ('\t' != *from))
Don't you think it should be &&
Can anyone confirm??
Regards,
Sandip.
|
|
|
|
|
SandipG wrote: Nandu_77b wrote:
if ( (' ' != *from ) || ('\t' != *from))
Don't you think it should be &&
Can anyone confirm??
Absolutely.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
It can't be && as I am reading char by char only one value will be there at one point of time.
|
|
|
|
|
It should be && because you neither want space nor tab.
Consider following cases with your current condition.
1>char 'a'
if(' '!='a' this condition will evalute to true so it wont even check next contition and it wil execute if block.
2 char ' ' space
here,
if(' ' != ' ' will evaluate false so it will go and check next condition i.e '\t' != ' ' which is true so again it will execute if block.
same applies for '\t' only firt condition will be executed and after that if block will be executed.
so in every case your if block will be executed
I hope now it makes sense.
Can anyone confirm if this is correct?
Regards,
Sandip.
|
|
|
|
|
Even i tried with '\t', but still i am facing the same problem.
string removeSpaces( string & str )
{
std::string::iterator to = str.begin();
std::string::iterator from;
for( from = str.begin(); '\0' != *from; ++ from )
{
if ( (' ' != *from ) || ('\t' != *from))
*(to ++) = *from;
}
if( *to != '\0' )
str.erase(to, from);
*to = '\0';
return str;
}
I have tested with && ...it is not working
|
|
|
|
|
Can you paste with your sample string for which it is failing?
Regards,
Sandip.
|
|
|
|
|
Nandu_77b wrote: string removeSpaces( string & str )
{
std::string::iterator to = str.begin();
std::string::iterator from;
for( from = str.begin(); '\0' != *from; ++ from )
{
if ( (' ' != *from ) || ('\t' != *from))
*(to ++) = *from;
}
if( *to != '\0' )
str.erase(to, from);
*to = '\0';
return str;
}
change to
string removeSpaces( string & str )
{
std::string::iterator to = str.begin();
std::string::iterator from;
for( from = str.begin(); str.end() != from; ++from )
{
if ( (' ' != *from ) && ('\t' != *from))
*(to++) = *from;
}
if( to != str.end() )
str.erase(to, from);
}
as others pointed out, the main flaw is the || operator instead of the && one.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
As advised earlier by SandipG and cPallini, you have to replace the OR-operator (||) with an AND-operator (&&).
It does work.
However, what doesn't work is when the iterator reaches the end of the string; you'll get an assertion. If this is your new problem it would help if you mentioned that.
Try putting what you're trying to do in words, almost as psuedo-code.
This approach will make you write more understandable and intuitive code, which will make things easier for you and others that have to read your code.
I set the insert location and the current location to the beginning of the string.
Until I've reached the end of the string I continue to...
Check if the current char is a space or a tab and if it is, I skip the char, otherwise I copy the char to the insert location.
In code it would look something like this:
std::string& removeSpaces( std::string& str )
{
std::string::iterator to = str.begin();
std::string::iterator from = to;
while( from != str.end() )
{
if( (*from == ' ') || (*from == '\t') )
{
++from;
}
else
{
*to++ = *from++;
}
}
if( to != str.end() )
{
str.erase( to, from );
}
return str;
}
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I used bitmaps for toolbar buttons.
Now I need to use background transparent images for those buttons.
I have the background transparent GIF images.
Can I obtain background transparent BMPs?
How can I use the GIFs for the toolbar buttons?
danginkgo
|
|
|
|
|
I can answer part of your question, at least.
If you look at the docs for LoadImage, one of the flags is:
LR_LOADMAP3DCOLORS, which replaces set colours with your systems (eg) dialog face colour.
Alternatively, ImageList_AddMasked has a "treat this colour as transparent" option you could uses. So, you could make a bitmap using bright pink as the background, then use that as transparent.
Assuming you're not making a Barbie themed app, of course...
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Thanks, I'll try
danginkgo
|
|
|
|
|
Hi everybody,
is it possible to get the Default Control of a view?
On a Dialog it works with GetDefID(), but this function doesn't exist for CView
Knows anyone a similar function?
Big thanks!
|
|
|
|
|
GetDefID() just throws a DM_GETDEFID at the window - which a dialog window supports. At best a normal window would just ignore you.
If you just have a CView, which you've messed about a bit, I'm not sure that a default button has any meaning for you.
What kind of view are you using, and what are you actually trying to achieve? And why don't you already know the default window - you created the view, didn't you?
Lastly, BS_DEFPUSHBUTTON is a BUTTON style, not a generic window style, which also limits its usefulness.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hi, thanks for your answer.
If you have 3 textboxes and a Button on the Dialog or View, you can switch into them via the Tab-Key.
Tab-Key sets the Focus to the next control and if the user hits the Return-Key, the "Default Button" is clicked.
In my Application it should be different.
You are into the 1. textbox, you enter a string and hit <return>, then the focus switches to the second textbox.
A <return> on the second textbox sets the focus to the third textbox and finally a
return on the third textbox presses the "Default Button"
I have a universal Form which contains a lot of functionalities to all of my views.
Now i added into PreTranslateMessage that a Return on a textbox sets the focus on the next control,
and not a click on the Default Button.
The only thing that i need to know is how i check if the actual textbox is the textbox before the Default Button.
In a Dialog it works with GetDefID() but in my UniView (derived from CFormView) there is no GetDefID()
Don't ask me why the navigation is so unusual
|
|
|
|