|
raju_shiva wrote: AExp
What is AExp ? You mean A power of ... ?
What is the '_' in front of 0.324 ?
Anyway, I think the only "difficulty" here is the power of functionality, which you can have by calling the pow[^] function.
|
|
|
|
|
Cedric Moonen wrote: '_
Yes its A power of
Cedric Moonen wrote: What is AExp ? You mean A power of ... ?
sorry its not _ ..its -0.324
Raj
|
|
|
|
|
Well, did you have a look at the link I provided ? You have everything you need to do what you are looking for.
|
|
|
|
|
Yes sir,i referred the link,which you had provided,
it was really helpful.thank you
I used this code to ghet the current date :
COleDateTime time;
CString str;
time=COleDateTime ::GetCurrentTime();
str.Format("%d:%d:%d",time.GetDay(),time.GetMonth(),time.GetYear());
//code to get the diff between current and previous date
COleDateTime currentDate, PreviousDate;
currentDate.ParseDateTime(str, 0, MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT)); // str is current date()
PreviousDate.ParseDateTime(Junk, 0, MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT));
int j = currentDate - PreviousDate;
current date foormat is 12:7:2010
previous date format is 12-06-2010
Any idea where i am doing wrong
Thanks
Raj
|
|
|
|
|
The - operator doesn't return an int but COleDateTimeSpan object. You should check the documentation.
BTW, please don't mix your different questions. This question was about the arithmetic operation, not the date difference.
|
|
|
|
|
Just a hint :
What about using a function ?
to get the data from edit box, well, you can read it all about it following this link : CWnd::GetWindowText[^]
Watched code never compiles.
|
|
|
|
|
In MS-DOS we had File Control Block and Bios file input output functions.
ex. FILE *fp and using fopen, fread, fclose and read, write, open for bios...
Is it directly supported in 32bit C (win32 sdk) Besides CreateFile ... etc...
And How we do interrupts in windows... I learned that system objects will not be in the same memory locations and the memory is divided into pages...
Is there anything like monitoring file creation and access so that we can prevent files being created... .
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
I think that depends on how you mean it. Hacking into an application to monitor its file operations is probably possible with API hooking, you probably can even do this for multiple applications, however, monitoring every file operatinon overall the system (including Windows' own file fiddlings) is a much much bigger pill to swallow. Not to mention low level monitoring (what goes on in the hardware)...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
I can't really tell from your question but you appear to be trying to find out:
- whether C stdio (FILE *) still exists. It does and works just as well as it always did. Please note that DOS FCBs were nothing to do with C's stdio library although ancient C compilers may have used them internally.
- whether the low level BIOS wrapper interface from 16 bit versions of C still exists. The answer to that one is that even if it does you won't be able to call it from a Windows app as Windows has a habit of killing apps that try using the BIOS to write to things they shouldn't.
You don't need to issue interrupts to get system services in Windows. Interrupts were just a way of providing a small (but complex) interface to the operating system. These days the userland libraries in your OS do that for you. In Windows they're NTDLL, GDI and KERNEL. Just call the functions and don't worry about the underlying details.
There are ways of monitoring file behaviour - security software does it all the time. You have to write a file system filter driver to do this though. If you do a Google search you'll find loads of confusing information to sift through.
Cheers,
Ash
|
|
|
|
|
Voila. That's a punch. Thank you.
Let me try those.
meanwhile... if people finding this thread and would like to drop some notes then please do so... so guys like me will get some useful info from that.
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Hello everybody !
Now ,I want to convert the vc project to vs2008.
when I complied this dll in vs2008:
it throw this error code :
1>c:\program files\microsoft sdks\windows\v6.0a\include\sdkddkver.h(217) :
fatal error C1189: #error : _WIN32_WINNT settings conflicts with _WIN32_IE setting
I search the macro "_WIN32_WINNT" in my project,but it isn't found defined this anywhere.
Now I add this code in the "stdafx.h":
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
At last, I delete the new SDK Include path in the vs2008.
but it failed too.
Why doesn't this error produced ,and how to solve it ??
Thans for you reply !
Best Wish for you !
|
|
|
|
|
Looks like the compiler is mixing up files coming from different SDK versions.
WINVER _WIN32_WINNT and _WIN32_IE should be defined so that the "components" are not newer than the API they run on.
Just give a look to the order of the directory search (include, libraries, DLL etc. should refer to the various SDKs in the same order).
Also, check if no ".h" file is missing in a new SDK (so that an older one is found in another)
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Yes ,you're right !
I install this version:
A、Microsoft Visual C++ 6.0
B、Visual Studio 2008
C、Microsoft Platform SDK for Windows Server 2003 R2
D、Microsoft Windows SDK v6.0A
So I try to uninstall the 'C' and 'D', and then to compiled it .
Thanks !
Best wish to you ,and your family !
|
|
|
|
|
I mean correct _WIN32_WINNT and _WIN32_IE on stdafx.h or define your header file.
On stdafx.h, You can see these definitions.
Code Snippet
#ifndef WINVER
#define WINVER 0x0501
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0410
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0600
#endif
Bolded value can be modified.
So you shoud change value .
It's up to your target machine's OS or API functions.
|
|
|
|
|
Hi sir,
I want the difference between two dates.
Suppose if the previous date is 11-07-2010 (in this format.)
I need to find the current date.
and also the difference between them.
Current Date - previous date.
how can i do this.
Thanks
Raj
|
|
|
|
|
You can use a COleDateTime[^] class for that purpose (by using the + and - operators).
|
|
|
|
|
Hi sir,
Suppose if i have one date in 12:7:2010(Current Date)
and other in 12-06-2010(P Date)
How can i find difference between them(P Date - Current Date)
Thanks
Raj
|
|
|
|
|
Why do you ask your question again ? Did you follow the link I provided and tried to understand the concept ?
|
|
|
|
|
I recommend you do not reinvent this. There are ATL classes you could use COleDateTime and COleDateTimeSpan. There are probably lots of other free classes as well.
|
|
|
|
|
The boost date_time library works pretty well if you don't want to use the MFC/ATL /WTL stuff that the previous posters have mentioned.
Another option is to use the humble time_t, remembering to convert between number of days and number of seconds. This is especially handy if you work with luddites that squeal about anything boost like.
Cheers,
Ash
|
|
|
|
|
chk it
COleDateTime prev_date;
CTime curr_time = CTime::GetCurrentTime();
CString curr_date_str;
curr_date_str=curr_time.Format(_T("%d-%m-%Y"));
COleDateTime curr_date;
curr_date.ParseDateTime(curr_date_str,0,LANG_USER_DEFAULT);
COleDateTimeSpan diff=(curr_date-prev_date);
|
|
|
|
|
Hi sir,
I tried with your code.
prev_date = "11-07-2010";
test2 = "13-07-2010";
COleDateTimeSpan diff=(test2-prev_date);
The diff is showing as null.
Thanks
Raj
|
|
|
|
|
CString str;
COleDateTime prev_date;
str="11-07-2010";
prev_date.ParseDateTime(str,0,LANG_USER_DEFAULT);
str=prev_date.Format("%d-%m-%Y");
prev_date.ParseDateTime(str,0,LANG_USER_DEFAULT);
AfxMessageBox(prev_date.Format("%d-%m-%Y"));
CTime curr_time = CTime::GetCurrentTime();
CString curr_date_str;
curr_date_str=curr_time.Format(_T("%d-%m-%Y"));
COleDateTime curr_date;
curr_date.ParseDateTime(curr_date_str,0,LANG_USER_DEFAULT);
AfxMessageBox(curr_date.Format("%d-%m-%Y"));
COleDateTimeSpan diff=(prev_date-curr_date);
int noofday=0;
noofday=(int)diff.GetTotalDays();
if(noofday<=0)
{
noofday=-(noofday);
}
CString days_str="";
days_str.Format("%d",noofday);
|
|
|
|
|
Hi!
i use localtime function to get current time, in "tm struct".
how do i get a new "tm struct" that adds the specified number of days to the value of this instance.
this is similar with DateTime::AddDays, but i don't use any MFC Class.
time_t t;
struct tm * tt;
char buffer[50];
time(&t);
tt = localtime(&t);
int dayOfWeek = tt->tm_wday;
tt->tm_mday -= dayOfWeek;
in this code there is a bug.
if tt->tm_mday < dayOfWeek then ???
please help me.
Zo.Naderi-Iran
|
|
|
|
|
Why don't you add the proper number of seconds (1 day is 86400 secs) directly to the time_t variable?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|