|
DavidCrow wrote: What's wrong with _access(..., 0)?
or _stat ?
Unicode?
|
|
|
|
|
Sceptic Mole wrote: or _stat?
Nothing that I know of. Why?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You can try:
BOOL PathFileExists( LPCTSTR pszPath );
-----------
Mila
|
|
|
|
|
I usually use GetFileAttributes() and check return value (and possibly GetLastError())
--
Filmed on Location
|
|
|
|
|
You can use of FindFirstFile and check return value of this file if file is exist it return a valid handle else null
|
|
|
|
|
Try opening it. If it fails, it doesnt exist.
Truth is the subjection of reality to an individuals perception
|
|
|
|
|
Thanks to you all.
In the end I will the easiest. I will try to open it to read and then check if it is open:
ifstream InSettingsFile(pDoc->ExecutablePath + "Settings.cfg",ios::nocreate);
if (!InSettingsFile.is_open())
{
AfxMessageBox("File does not exists");
}
The PathFileExists function looked promising but then you need some include which I don't seem to have or something. You know, I am beginner with this stuff and don't really have the time to look for "optimal" solutions.
Ciao
Giulio
|
|
|
|
|
You are right.
You know, I am beginner with this stuff and don't really have the time to look for "optimal" solutions.
Some of us here are very experienced developers, and WE don't always have the time to provide you with optimal solutions either ...
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
I dynamically created a button "View" on sub-class of CPropertySheet.
when I press F1 key then click the button, system (?) displays a message "No help topic is associaated with this item".
how to hide or disable the message because I want to use F1 key + clicking the button for something else - not related to help issues?
|
|
|
|
|
you will have to override
OnHelp() handler of the button
|
|
|
|
|
Hi,
I have created a new child window with folowing method in VC++
AfxGetMainWnd()->SendMessage(WM_COMMAND, ID_FILE_NEW);
and directed my output display on this window.
But when I press a key there is no response or LButtonDown Doesn't respond to this window.Only RButtonDown Works on this window.What Should I do to get the focus?
Thanks
Prithaa
|
|
|
|
|
Hi,
I want to read excel files as we read comma delimited files . I want to read them in C++.Can anyone help me?
Prithaa
Thanks
|
|
|
|
|
Ok, so what exactly is the problem?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Can I read excel files in the same way as I can read comma delimited files through fopen() and get() commands and what will be the delimiter in case of excel files
Priya.
|
|
|
|
|
You can ready any file as long as you know its format. Why do you want to read the file directly when Excel Automaton is much easier, and less prone to error(s)?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to initialize my static variables to maximum of the value of float, for which i defined:
<br />
const double LogMath::FloatMin = numeric_limits<float>::min( );<br />
const double LogMath::FloatMax = numeric_limits<float>::min( );<br />
const float LogMath::LogMax = log(FloatMax);<br />
const float LogMath::LogMin = log(FloatMin);<br />
in my cpp file (vs.net 2003). On doing so i get weird (?) errors as below:
<br />
error C2589: '(' : illegal token on right side of '::'<br />
error C2059: syntax error : '::'<br />
error C2059: syntax error : ')'<br />
error C2059: syntax error : ')'<br />
Using numeric_limits<float>::min() or numeric_limits<float>::max() in a seperate test exe didnt give any errors.....
Whats happening? Please help.
|
|
|
|
|
This is managed C++ no ? So post in the correct forum[^]
|
|
|
|
|
No, it is standard C++. He is fine where he is at.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
rockychaudhary wrote: const double LogMath::FloatMin = numeric_limits::min( );
const double LogMath::FloatMax = numeric_limits::min( );
Have you tried:
const double LogMath::FloatMin = std::numeric_limits<double>::min( );
const double LogMath::FloatMax = std::numeric_limits<double>::min( );
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
That is what i was doin at first.....
I ended up wrinting the values of min and max of float as
<br />
const double LogMath::FloatMin = 1.17549e-038;<br />
const double LogMath::FloatMax = 3.40282e+038; <br />
But would still love to know what was going on......
And thanks for replyin
|
|
|
|
|
rockychaudhary wrote: I ended up wrinting the values of min and max of float as
const double LogMath::FloatMin = 1.17549e-038;
const double LogMath::FloatMax = 3.40282e+038;
But would still love to know what was going on......
numeric_limits is a member of the std namespace. So, unless you have a using namespace std; or using std::numeric_limits; line somewhere, you have to specify the namespace.
Additionally, numeric_limits is a template that needs the type specified. If you don't include the numeric_limits<double> part, the compiler doesn't recognize it as a type (because it isn't).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
modify first line as 2 lines:
const double LogMath::FloatMin = 0;
double db=numeric_limits::min( );
to see which line is error.
|
|
|
|
|
i modified the code as below:
<br />
const double LogMath::FloatMin = 1.17549e-038;<br />
const double db = numeric_limits<float>::min( );<br />
const double LogMath::FloatMax = 3.40282e+038; <br />
const double dc = numeric_limits<float>::min( );<br />
but ended up with the same errors
any other tips ?
Thanks for replyin
|
|
|
|
|
Hi,
I have created a new child window with the following method
AfxGetMainWnd()->SendMessage(WM_COMMAND, ID_FILE_NEW);
but when I display data on this window, the display starts on the left border of the window and then I need to give CRect.left +10 for the x-coordinate so that the data is properly displayed after the border line and
I can see the border line.
Can I avoid this +10 somehow so that I can directly use
GetClientRect(Rect) and print on Rect.left ?
Thanks
|
|
|
|
|
Take a look at SetWindowOrg() and SetViewportOrg().
Here[^] is an excellent article that you can use to alleviate any confusion you may have about those functions.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|