|
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.
|
|
|
|
|
Ok, everytime I enter aa code with anny of the #include starters, i get 103 errors and 2 warnings, and then I look for them, and it opens a new window "tab" thingy, and otsream, or istream or math or w/e i am using comes up. It makes testing fully written programs impossible to test. Does anyone know how to fix it??
"The beauty of Grace is that it makes life not fair" Relient K, Be my Escape
|
|
|
|
|
You can get this type of error if one of your include files has a procedure/function definition statement that is missing a ;
|
|
|
|
|
can you paste the first error message please ?
also, give us a relevant piece of code so that we can see what's wrong there...
|
|
|
|
|
Just look at the display name of the OP. That must give you a clue.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
it looks like this,
<br />
int __declspec(dllimport) LSCardAtStartAPI(DvbAtApi **h, CEvent *ShtDn, CWnd *Wnd,...)<br />
and it compiles in another project on the same machine.. in fact these two projects share this file, but one of them gives me a syntax error...
(my guess: what VC++ 6.0 compiler setting am I looking for???)
|
|
|
|
|
It might help if you offered the *exact* error message.
"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
|
|
|
|