|
Hi all...
I am having a string
i.e *.doc,*.xls,*.pdf,*.mdb.
I want to seperate each other..
just like..
.doc
.xls
.pdf
i am not getting how to seperate it...plz give me some idea..
thank you in advance...
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
How about tokenizing the string based on ',' delimiter and then extracting the characters after the '.' to get the extensions. You can tokenize the strings using strtok. There could be better ways of tokenizing the strings using Regular Expressions.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi..
thank you..
its worked..
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Hi..
I am having
_TCHAR *sFileExt;
I wnt to convert it to char[]..
i.e
_TCHAR string[] = SFileExt;
I am getting the error....
Error:cannot convert from '_TCHAR *' to '_TCHAR []
How can i..
tahnk you
mannju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
string copy needed, see _tcscpy[_s]().
BTW, what about learning C/C++.
|
|
|
|
|
Hi..
I am learning sir...u still remember me
thnak you
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
You can also use string streams.
#include "string"
#include "vector"
#include "sstream"
...
string sResult(_T("Hello,can,you,split,me?"));
istringstream ResultParser( sResult );
string sToken;
vector vResults;
while ( getline( ResultParser, sToken, ',' ))
{
vResults.push_back( sToken );
}
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
also you could have a look at CString::Tokenize
"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$$>
|
|
|
|
|
|
See here[^]
And have a look at the file cstringt.h
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks Rajesh. I just searched the CString class members only.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
My fault this member function is available is VS2002 and upward, it doesn't available for people using VS6.
you have two option for same, if you still want to use said CString function, either download the WTL classes or rip apart CString code from upward version of VS and include same in your source code
"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$$>
|
|
|
|
|
See does this[^] thread helpful?
|
|
|
|
|
Hi all,
I am working on VC2005 in Vista. I have made a DialogBox in that i have made several Edit boxes, in one of my edit box i am specifing output directory name. My problem is if i click back on that edit box the value just disappears, directory is created at the specified path but output value is not displayed.
How can i resolve this....
Thanks in advance
|
|
|
|
|
VCProgrammer wrote: My problem is if i click back on that edit box the value just disappears,
It just can't "disappear" like that! Either somewhere UpdateData is being called wrongly or some part of your code is making it behave like that.
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
coudl you please provide us the prevuiew of button click event!
"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$$>
|
|
|
|
|
Either you are setting "" in Setfocus option or UpdateData is not called properly.
Sudhir Kumar
|
|
|
|
|
Did you use of UpdateData or setwindowtext on your code?
|
|
|
|
|
hi...
How can i call "CFileDialog" in "testDoc.cpp" which is not inherited from CWnd Class.
i tried the following
/****************************/
BOOL Test()
{
CFileDialog dlg(FALSE,............,NULL);
return TRUE;
}
/***************************/
but it was not working!!!!!and showing error when function returns!!!
Is there any need to delete the object.
How can i approach?????
|
|
|
|
|
BOOL Test()
{
CFileDialog dlg(FALSE,............,NULL);
dlg.DoModal(); //
return TRUE;
}
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have done that and i did some extra stuff when i click Save and when i click cancel. but after that when the function return s then it arises EXCEPTION error.
Thanku....
|
|
|
|
|
What error it shows,When returns.
Sudhir Kumar
|
|
|
|
|
hi...
" Un Handled error Exception arises...."
|
|
|
|
|
This is actually a known bug that comes about due to the size of the OPENFILENAME structure being used with MFC. You need to define _WIN32_WINNT to be 0x500 , and set the lStructSize member to to 88 (instead of 76). You might also need to use GetOpenFileName() instead of CFileDialog() .
"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
modified on Wednesday, June 4, 2008 8:45 AM
|
|
|
|
|
For example:
open("c:\\goodssale.dat",ios::binary|ios::in|ios::out)
cann create a file in "c:\\goodssale.dat"
but how can i create the file in the folder of the program
|
|
|
|