|
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
|
|
|
|
|
gtzygtzy wrote: but how can i create the file in the folder of the program
You need to determine the programs current working folder (CWD). Have a look at GetCurrentDirectory() or _getcwd() . You might also consider GetModuleFilename(NULL, ...) .
"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
|
|
|
|
|
|
Ohh great!
"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$$>
|
|
|
|
|
gtzygtzy wrote: but how can i create the file in the folder of the program
Use GetModuleFileName to get full path of your program and then use PathRemoveFileSpec to get the parent folder of your program.
For e.g. if your program is in C:\Program files\Myprogram then path returned by GetModuleFileName is C:\Program files\MyProgram\YourProgram.exe and then PathRemoveFileSpec removes the file part and returns C:\Program files\MyProgram.
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
|
|
|
|
|
BTW, if you specified only the filename without path, "goodssale.dat", it creates file in the current working directory, and the fullpath to the executable can be obtained from the first argument of the argument vector (commandline parameter) of main function.
|
|
|
|
|
this link might help :-
http://www.visualcpp.org/?p=92[^]
"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$$>
|
|
|
|
|
And for more info you can check that file is exist or no with FindFirstFile if you want to keep values of file if it's exists.
|
|
|
|