|
Hi everyone!
My problem:
- I've got two programs
- both programs are located in the same directory
- each one writes data to a file named "c:\prog\bin\protocol.log"
- the file "protocol.log" get's corrupt
My question:
Is it possible to change the environment of one program so that it writes to another location?
|
|
|
|
|
Why dont you give the protocols different names? (log"Process ID".log)
You better write the logs in a user directorcy, are you get trouble on Vista.
Greetings from Germany
|
|
|
|
|
Do you have source code of these programs?
|
|
|
|
|
No I haven't. Otherwise there won't be a problem!
|
|
|
|
|
Yes it is possible to modify the environment and/or hook NtOpenFile. But there are probably better solutions which should be tested first.
If the program is writing to its 'working' directory: Have you tried creating a shortcut to the executable and modifying the "Start In" directory?
Best Wishes,
-David Delaune
|
|
|
|
|
Ah cool! Thanks for your advice!
I found what I'm looking for: www.codeproject.com/KB/system/soviet_protector.aspx
|
|
|
|
|
Hi all.
See i am reading certain mails i want to sort them by mailDate in Decresing order...and write into xml..
Now i am reading the mail as it is and writing into xml file...
how i can compare it and write so it will be in ascending order..
for(int y=0; y<(linfo->ACL_STMAIL[0].iMBUserMailCount); y++)
{
_tprintf("\nMails found between %s date and %s date\n",linfo->sStDate,linfo->sEndDate);
mailDatee = linfo->ACL_STMAIL[y].cMBUserMailDate;
mailDatee.Remove('/');
if(linfo->ACL_STMAIL[y].bMBUserMailHasAttachment)
{
AttachCount=linfo->ACL_STMAIL[y].iMBUserMailAttachFileCount;
for(int i = 0;i < (linfo->ACL_STMAIL[y].iMBUserMailAttachFileCount); i++)
{
elementName [0] = "NAME";
elementValue[0] = linfo->ACL_STMAIL[y].cMBUserMailFromName;
elementName [1] = "EMAIl";
elementValue[1] = linfo->ACL_STMAIL[y].cMBUserMailFromEmail;
elementName [2] = "DATE";
elementValue[2] = mailDatee;
elementName [3] = "TITLE";
elementValue[3] = linfo->ACL_STMAIL[y].cMBUserMailSubject;
elementName [4] = "BODY";
elementValue[4] = linfo->ACL_STMAIL[y].cMBUserMailTextDesc;
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Hi..
I am having the date in format..
20080430 8:36:05 and 20080423 13:49:19
I want to compare which is greater...any suggestion..
thank you
manju..
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
Well, if you are using COleDateTime, you could use the relational operators ( == , != , < , > , etc.,) [^] of that class. The linked page has an example too.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
if the format is always fixed (i.e. there must be two spaces between 20080430 and 8:36:05 in your sample string) then a lexicographic comparison is enough, that means strcmp will do the magic:
const char * date1 = "20080430 8:36:05";
const char * date2 = "20080423 13:49:19";
int icmp = strcmp(date1,date2);
if ( icmp > 0)
{
}
else if ( icmp < 0 )
{
}
else
{
}
On the other hand. If the format is not fixed then you're a (actually not so much: it is fairly easy to repair it) unlucky girl.
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]
|
|
|
|
|
I want to set font of caption of static text control (lebel) in ATL.
|
|
|
|
|
You posted this question yesterday at two different forums and now, again. What's wrong with the answers you got? Reposting/Crossposting is rude and will get you ignored in no time.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Sorry, But i am not getting the proper answer and this is the last time i am doing.
|
|
|
|
|
|
|
How to place pushbuttons using CButton class with the help of Create function on Menubar (not on client window) . Is there any posibility? Try to help me pl.
k.sreedevi
|
|
|
|
|
sreedevi kolli wrote: Is there any posibility? Try to help me pl.
Have a look at CDialogBar class, quite easy to use! Will not be on the menubar though, will act as a toolbar.
Nibu babu 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
modified on Friday, June 20, 2008 5:21 AM
|
|
|
|
|
There seem to be no mfc function for copying entire directory.
The closest match is MoveDirectory() which will result in one copy of the folder being moved.
Is there any way to do that?
|
|
|
|
|
Do you want to copy files if yes see SHFileOperation .
|
|
|
|
|
Hi
how to get the export function list in dll
i think there is some option in command promt
thanks
shakumar
shakumar
|
|
|
|
|
shakumar_22 wrote: i think there is some option in command promt
There is DUMPBIN command line tool [^].
You may also use, for instance, Dependecy Walker GUI tool [^].
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
|
|
|
|
|
Hello,
I have curve data into an array and I need to apply a low-pass filter (Bessel and Butterworth) on it.
The sampling rate of my data is not constant (for example, I get a value at 1s, then 1.2s, then 1.8s...).
As I said, the curve data are in an array, and the corresponding timestamps are in another :
double time[] = { 1.0, 1.2, 1.8, ... }
double value[] = { 3.1, 4.4, 5.0, ... }
By reading wikis and web sites, it seems that applying a low-pass filter will attenuate the high frequencies (i.e. higher that the cutoff frequency). The attenuation will depend of the type of the filter (Bessel, Butterworth, ...) and its order.
Please tell me if I am wrong!
In other words and in my case, if I have two timestamps which are "to close" (for example : 1/(time[1]-time[0]) > cutoff), I need to modify the corresponding value (value [1]). The new value will be given by the transfer function (which depends, again, of the type of the filter and its order).
Is that right or I am totaly lost ?
If all of this is right, then, how to get the new value ? Taking a look to wikipedia tells me a lot about bessel/butterworth transfer functions, but I do not understand how to apply them.
Could someone provide me an algorithm ?
If all of this is wrong, then, could you please correct me ?
Thanks in advance.
|
|
|
|
|
Possibly this page [^] may help (see reference to Numerical Recipes in C).
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
|
|
|
|
|
Well, thanks for the answer, but Numerical Recipes does not seems to respond to my problem.
|
|
|
|