|
Not sure if it's an agreement or not...
Let's say: no memory corruption occurs!
|
|
|
|
|
Hy,
i am using CFileStatus to get the date and time when the file was last modified.
By some files time is one hour earlier or later, but only by some files?
Does anybody have a clue why this happens?
cfile.GetStatus(m_filepaths[i], m_status);
Date=m_status.m_mtime.Format( "%d.%m.%Y %H:%M " );
|
|
|
|
|
I would guess "summertime".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Do you have any idea how to fix this?
|
|
|
|
|
Not before you can confirm that it is broken; are the files that lack an hour created during the same period, or is it distributed randomly?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have a little bit check files. Files that where modified round in period betwen November and April have time one hour later.
|
|
|
|
|
The m_mtime.Format method returns a time formatted according to the local timezone, so it may well be one hour out. You should use one of the alternative methods (see CTime Class[^]) to get the absolute time.
|
|
|
|
|
This can occur when files are stored on FAT file systems. NTFS stores all dates in UTC while FAT uses local times. The local time from FAT file systems is converted when getting the time. But this will return wrong values when the time stamp has been written by a system that uses a different time zone than the one used to read the time stamp.
See also File Times (Windows)[^].
|
|
|
|
|
|
Hi, I just need instructions to build my working source code in C++ into a dll that is compatible with Windows 7.
Thanks.
|
|
|
|
|
|
Assuming that your code has no linux OS calls in it and is just generic stuff you just define an interface for it and compile it like Jochen's answer.
If you have linux OS calls you will need to build windows replacements or use a framework.
In vino veritas
modified 29-Jun-16 13:29pm.
|
|
|
|
|
Hi, I need your help a bit in C++.
I am coding a dll but my source code has 2 errors.
Both issues stem from the same declaration in my header file.
void execute_assert(bool expr, std::string str);
When I do the function calls...
v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");
and
v_assert(s < 1, "Illegal acl size (" + deb + ")");
I get the error message...
Error: too many arguments to function ‘void execute_assert(bool, std::string)’
On both counts, the parameter count is ok, so what's the problem?
Please help.
|
|
|
|
|
Does v_assert() call execute_assert() or vice-versa?
Member 12244972 wrote:
v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small"); Shouldn't this be:
v_assert(s == MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small"); or maybe
v_assert((s == MAX_ACL_DEPTH), "MAX_ACL_DEPTH too small");
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
I was making the wrong function call.
v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");
should have been
execute_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");
Problem fixed.
Thanks all.
|
|
|
|
|
Where is the definition of v_assert , is is a macro?
|
|
|
|
|
I was making the wrong function call.
v_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");
should have been
<pre>execute_assert(s = MAX_ACL_DEPTH, "MAX_ACL_DEPTH too small");
Problem fixed.
Thanks all.
|
|
|
|
|
I am trying to output certain int variables to my logfile. But upon viewing the logfile these varuiables are shown in hex. any idea why this happens?
ofstream logfile;
GetLocalTime(&st);
sprintf(logfilename,"Myfilename_%d%02d%02d.log",st.wYear,st.wMonth,st.wDay);
logfile.open(logfilename, ios::app);
logfile <<"# Time is :: "<
|
|
|
|
|
I don't know why your stream uses hex format here. But you can set the format: ios_base::fmtflags - C++ Reference[^].
Because you are still using the C library function sprintf for the file name you might use it also for formatting the output. I still prefer this because it is often simpler (e.g. for date and times with leading zeroes).
|
|
|
|
|
I just ran the above code and the values are all in decimal. There must be something else in your code that is causing the issue.
|
|
|
|
|
Actually this is only a part of the code. I have int variables declared and those are also displayed in hex in the logfile.
will it have something to do with the settings while I build the same in Visual C++?
|
|
|
|
|
No, but somewhere you are setting the stream attributes to display all integers in HEX rather than DEC format.
|
|
|
|
|
Thanks a lot.. There are instances in the code where the stream is set to hex. Upon removal the same works fine.
But is there a way without removing hex and set the stream back to display DEC ?
|
|
|
|
|
Found out the way to do that without actually removing Hex. Used <
|
|
|
|
|
Hi all,
I have a for loop parallelized with openMP. Inside I want to catch possible exceptions. My idea is that the caught exception should be a private variable, as it is possible that several exception occur parallel. But I cannot express this.
example:
#pragma omp parallel for default(none)
for ( int i = 0; i < 10; ++ i )
{
try
{
}
catch ( const std::exception& e )
{
e;
}
}
This yields to compiler error:
error C3052: 'e' : variable doesn't appear in a data-sharing clause under a default(none) clause
But I cannot mark the exception variable as private, as I is not known at that scope.
I can bypass the compiler error by changing the default sharing behaviour to shared, but I think this could lead to a runtime error, if two exceptions occur at the same time.
What is the correct way to deal with this?
Thanks in advance,
Joerg
|
|
|
|