|
I would have a look / search for FindFirstChangeNotification . This lets you monitor any
changes to files in a directory. If that is not enough, look at FileMon on www.systinternals.com[^] and
be impressed at the amount of work that took... As I understand it, they had to write a filesystem
driver to sit below the user processes. Gnarly.
Iain.
|
|
|
|
|
i would like to compare date like
DDMMYY > DDMMYY
pls giv me some codes that can somehow do this thx
|
|
|
|
|
Construct 2 CTime objects (cTime1, cTime2):
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
then you'd compare them (cTime1 > cTime2).
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Construct 2 CTime objects (cTime1, cTime2):
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
wat do u mean by construct 2 ctime object?
do u mean like
int ctime1;
int ctime2
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
like this?
if wrong pls show me how to contruct correctly so far i only contructed int,char,string ad some others basic 1 ^^ thx u
|
|
|
|
|
In this example it's compared the current time with a fixed date .
<br />
CTime ct1, ct2;<br />
ct1 = CTime::GetCurrentTime();<br />
<br />
ct2 = CTime(2005, 07, 30, 23, 01, 00);
<br />
if(ct1 > ct2)<br />
{<br />
}<br />
else<br />
{<br />
}<br />
I hope that it's what you wanted,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
In addition to Marc's suggestion, if you'll simply put the dates in YYYYMMDD format, then you can easily compare them.
ASSERT(20050726 > 19680906);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Construct 2 CTime objects (cTime1, cTime2):
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
wat do u mean by construct 2 ctime object?
do u mean like
int ctime1;
int ctime2
CTime::CTime( int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec, int nDST = -1 );
like this?
if wrong pls show me how to contruct correctly so far i only contructed int,char,string ad some others basic 1 ^^ thx u
|
|
|
|
|
I'm sure you meant to respond to marcdev instead.
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
this is my code
it seems alrite to me but the output seem weirld since it displayed >>1.8999e-007<<wich i="" have="" no="" idea="" where="" this="" came="" from="" pls="" help
run="" it="" and="" see="" for="" urself
#include="" <iostream="">
#include <string>
#include <time.h>
#include <iomanip>
using namespace std;
int main (void)
{
float a2=5.55;
int star=0;
float sux,a3; //test
float money[6] = {1.00,0.50,0.20,0.10,0.05,0.01};//types
int moneychange[6] ;//change
for (star=0;star<6;star++)
{
moneychange[star] = a2 / money[star];
a2 = a2 - (money[star] * moneychange[star]);
cout << moneychange[star]<
|
|
|
|
|
What's wrong ? It's the result of your maths ...
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Ok, the problem is the way doubles are handled which causes your "bug". A rounding factor gets accumulated so to do what you want to do I think you best introduce an extra variable...
Following code works:
<code>float a2=(float)5.550;
float money[6] = {(float)1.00,(float)0.50,(float)0.20,(float)0.10,(float)0.05,(float)0.01};//types
int moneychange[6] ;//change
float accounted=0;
for (star=0;star<6&& accounted < a2;star++)
{
moneychange[star] = (a2-accounted) / money[star];
accounted += money[star] * moneychange[star];;
cout << moneychange[star]<<endl;
cout << a2-accounted<<endl;
}</code>
|
|
|
|
|
|
well.....i m a beginner n i m asiigned he task to write a code in vc++ that shoule ensure that "work ofline " option in file menu shoud remain unchecked ......... can any body help me\?????????????????????????????????
|
|
|
|
|
miss taqdees wrote:
can any body help me
Sure. What exactly do you need help with? Show us the code that is giving you trouble and I'm confident that someone here will critique it for you. If, however, you have not bothered to write any of the code yourself and are simply wanting someone to do it for you (i.e., this is the opposite of help), best of luck.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
surely i dont wish for someone to write the code for me...........its just that can somebody tell me any functions or classes that might help me............like how to access internet explorer with c++ and how to get access to file menu etc..............not CODE...only some guiging material.................thanks
|
|
|
|
|
Someone please tell me how to use lineMonitorTones(.
I want to detect ringback and dialtone.
Thank you
|
|
|
|
|
Hi,
I want to use the string in switch case statement. Can you please help me.
Thanks
|
|
|
|
|
I can only guess and believe you might want to do something like this:
<br />
switch (myString) {<br />
case "Blue":<br />
...<br />
break;<br />
case "Red":<br />
...<br />
break;<br />
...<br />
}<br />
Trouble is, the C or C++ languages don't do that. C# does. Thus, one solution is to use C#. If you want to use C/C++, you must use nested if/else clauses to emulate the same effect, something like so:
<br />
if (_tcsicmp(myString, _T("blue")) == 0) {<br />
...<br />
} else if (_tcsicmp(myString, _T("red")) == 0) {<br />
...<br />
...<br />
}<br />
Doesn't look as nice, but, compared to the above fictivious switch statement, gives you control over the comparison algorithm (e.g. use _tcsicmp for case-insensitive comparison, or _tcscmp for case-sensitive comparison), etc.
|
|
|
|
|
You cannot use a string in switch cases - the cases have to be constant numberic values.
If the strings are not known at compile time, then you have to use if...else if...else
statements.
If they are known at compile time, then you can precompute hashes of the case strings,
and switch on a hash of the string you want to switch on. Um, that wasn't very clear,
was it?
void DoSomethingDependingOnString (LPCTSTR szSwitchable)
{
switch (ComputeHash(szSwitchable))
{
case 0x4wfe:
DoFirstThing ();
break;
case 0xfg13:
DoSecondThing ();
break;
default:
DoDefaultThing ();
break;
}
}
I hope that was little clearer.
Iain.
|
|
|
|
|
I would recommend not to use the hash approach, for at least these:
i) it is hard to maintain - always think a couple of years and several generations of fellow programmers ahead. Who's going to remember how to create the keys, why and when?
ii) it is doomed to fail - hash keys are not unique, so there is a chance that two different strings produce the same key.
|
|
|
|
|
berndg wrote:
ii) it is doomed to fail - hash keys are not unique, so there is a chance that two different strings produce the same key.
If you have a finite set of possible strings known at the program development time, you can create a "perfect" hash function[^] that doesn't cause collisions.
|
|
|
|
|
|
The actions include save as , print, local copy, copy on the net and so on.
My english is very poor!
|
|
|
|
|
Your English is fine, but your explanation is a bit weak. Exactly what is it that you want to do?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I want to monitor the operations to a file which like save as, print, local copy, network copy, attach to a mail and so on.
Have I explain my request clearly?Please help me,thanks!
|
|
|
|
|