|
I thing the best method to identify the last character in CString is:
if(csText.Right(1)=="\\") dosomething();
Please note the double \ between " because \ is so called escape character.
|
|
|
|
|
you are using escape character. To compare backslash you have to add extra backslash(\\).
so try this...
if (csText == "\\")
Mukesh Kumar
Software Engineer
|
|
|
|
|
Well, while you do need to escape the backslash by using \\ instead of \ , your test checks the entire string, not the end of the string.
You can use a variety of methods to test the last character of the string - operator[] , ReverseFind(...) , etc.
int iLength = csText.GetLength();
if( iLength != 0 )
{
if( csText[ iLength - 1 ] == '\\' )
{
}
} Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Since you have a CString, you could use the ReverseFind method:
if(csText.ReverseFind(_T("\\") == csText.GetLength() - 1) This checks to see if the 0-based index of the \ character is the last character.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
piul wrote:
But I can't write if (csText == "\") because the "\" gives an error...
|
|
|
|
|
Hello,
Do you know how to uncheck the: "Keep the taskbar on top of other windosw" by WinAPI?
I need to uncheck it from my application, so the window taskbar wont be 'on the top' of my application window,
Thanks!
|
|
|
|
|
I thought it would be in HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, but found nothing definitive.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
If you are talking about the Auto Hide option, this setting does not have an API for changing it, so you may have to do some spelunking.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
TalSt wrote: I need to uncheck it from my application
Are you sure that's what you want to do? I would never use an application that did that to me.
Perhaps you want your application to be "Always on top"?
led mike
|
|
|
|
|
I'd have to agree with ledmike. Did you buy this computer for the end user? If not, why should you mess it up for them? They may *want* their computer the way they like.
If you supplied the computer, then change the taskbar before you send it to them?
If you need to cover the whole screen when running, I'll be skeptical, but you can use an always-on-top style. At least the use still has their pc the way they like it for when they're not running your application.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
The taskbar should be 'not top most' when my application is running.
I set it to 'not top most' at the InitInstance() and to 'top most' at the destructor.
I can not change the mainform of the application to top most from some other reasons...
thanks!
|
|
|
|
|
Hi,
I am planning the above move. From what I have read until now, it certainly is not a trivial task. Can someone kindly point me in the right direction in terms of help documentation/blogs/forums/discussions?
Regards.
|
|
|
|
|
A good starting point [^].
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
|
|
|
|
|
MethodToChaos wrote: it certainly is not a trivial task
yes this is not trival task. just try to export your project in VS.NET and compile it and solve the compilation problem one by one.. thats the only way you convert your project to new enviornment.
Please see, VS2005 are more type compliant and non relaxing. so prepare for some hardwork
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
the codeproject has some articles maybe they will be helpful for you.
|
|
|
|
|
Hi to all!
My app is using threads sometimes, and in each one I do some work with MySql database (version is 4.0.21). When I exit my app I get numerous resource leak like "Resource like : allocated by InitializeCriticalSection in C:\....\¸mysys\my_thr_init.c".
Any help and how to avoid this?
I read somewhere to use thread specific api's like 'mysql_thread_init()' or 'mysql_thread_end()'. The thing is I open connection at start which i use all the time, and then close it when I exit the program.
P.S.
I don't use thread all the times I also do some work with database at program's runtime.
Thanks!
|
|
|
|
|
Hi,
Is there any way to find out the call stack, as I want to check if a particular function is being called in a call stack?
Thanks,
Mushq
|
|
|
|
|
If you are using VC 6 then use Alt + 7 or from Menu View, Debug Windows, Call Stack.
OR
If you are using version higher than VC 6 (like VC7,VC8) then use Alt + 7 or Alt + Ctrl + C or from menu Debug, Windows, Call Stack.
Mukesh Kumar
Software Engineer
|
|
|
|
|
Hi Mukesh, Thanks for the reply.
ctually I want to access it by code i.e. programmatically accessing the call stack. Sorry for the confusion.
Regards,
Mushq
|
|
|
|
|
What do you mean ? Do you want to access it by code ? Or just look at it yourself ? If it is the latter, it depends of which IDE you are using. For VS2005, you go into 'Debug' -> 'Windows' -> 'Call Stack'. You have of course to start debugging. The call stack will be displayed whenver you hit a breakpoint.
|
|
|
|
|
Thanks for reply.
Cedric Moonen wrote: What do you mean ? Do you want to access it by code ? Or just look at it yourself ?
Actually I want to access it by code i.e. programmatically accessing the call stack. Sorry for the confusion.
Regards,
Mushq
|
|
|
|
|
|
I need to add " to a string both at the beging and ending of the string and make the string looking like
"test string"
" should also part of the string... pls advice
|
|
|
|
|
You need to add an escape character ('\' before the character). It will look like this: \"test string\".
|
|
|
|
|
char ch ='\"';
lgAssistantLocStr = ch + LocStr + ch;
I am getting expected string but it is not working as excepted.... is that due to some interal problems...pls advice
|
|
|
|