|
i've got the memory location as follow
addres1: 0x00322360
addres2: 0x0032236c
which one is greater! Thanks
|
|
|
|
|
Number 2
Regards,
Brian Dela
|
|
|
|
|
Hi there.
Im working on a project at the moment a sort of Search program if you will. However there is obviously going to be a problem with the system if the user doesnt use it for so many days, files will have been deleted / created / modified etc.
A solution would be a small program which logged files changes to a text file. Such as new files created, modified, moved, deleted etc. This file would be loaded by the main app and the database updated.
I have researched Visual Basic and found out about "hooks". However i dont believe these stretch to this kind of activity and as ill link to below the program below uses C++.
The following program does what i want i suppose, and the source code is free, but theres no explanation to much of it and i was wondering if anyone had tutorials / source code on this complex thing.
http://www.sysinternals.com/ntw2k/source/filemon.shtml
Thanks greatly.
Gavin
|
|
|
|
|
|
Thank you soo much.
The only thing is though to make that monitor every fixed hard drive i would probably have to do a recursive search through each directory, which would be a major hit on performance for something thats running the background.
Any suggestions?
(Ive posted this without looking at the code so i may be able to work it for myself.)
Thanks.
Gav
|
|
|
|
|
Forgot my password!
Ive just found out that code only works on Windows NT / 2000 and XP. Which isnt any use to me as im on Windows 98 SE.
Gutted
Thanks again for the information but if anyone has anymore information etc i would be very grateful!
Gav
|
|
|
|
|
I think you'd need to do the recursive search once. After that, you may be able to use this class[^] to add/remove directories of interest. It would be cool if you wrote a new version of Wes Jones' CDirectoryChangeWatcher class that supported recursive watches!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks again for your help.
Damn... this is going to take some coding!
Does the code you suggested work with Windows 98?
Thanks for all your input.
Any other suggestions from other people?
Gav
|
|
|
|
|
Anonymous wrote:
Does the code you suggested work with Windows 98?
Sorry, I haven't used these classes.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
hi,
I have a base class say,CEmployee and other derived classes say CManager,CDirector etc.
CEmployee is CObject derived for getting all those features from CObject.
Now,I have a list of employees (CEmployee*) in stl list<> and I serialize them.Everything is fine while storing,but while loading i cannot get the correct class and will just read CEmployee.
How to use the RTTI for serialization.
-Conan
|
|
|
|
|
|
Yah, read that but not enough info.
|
|
|
|
|
When you save the objects to disk, the first thing you should serialize is the object's signature (or RTTI information), followed by the object itself. When you read back the object from disk, use a ClassFactory pattern to construct an object of the appropriate type, then serialize (read in) the object.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
:-DSorry if i am a pain but its bit tricky at the moment.
Should I implement the class factory .If we use CObList or something,everything gets done from CArchive.But i am using stl list<> holding pointers.How to implement it?
|
|
|
|
|
Write the employee list to disk like this:
for (each employee in list) {
CString strSignature;
*pArchive << pEmployee->getSignature();
pEmployee->serialize (pArchive);
}
When you read the object from disk, do this:
CString strSignature;
strSignature << *pArchive;
CEmployee* pEmployee = EmployeeClassFactory.createObject (strSignature);
if (pEmployee == NULL) {
} else {
pEmployee->serialize (pArchive);
}
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
So this means I will have to write my own class factory.
Why can't ar>> pEmployee do the job here when a similar thing can do it for CObList in the MSDN sample DrawCli.
Thanx for answering
|
|
|
|
|
I haven't seen the DRAWCLI sample. If it works by using the streaming operator >> , it's because the Employee class's >> operator is doing the work of a class factory.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Before storing each object save an identifier for each object. Use CObject::GetRuntimeClass() and store CRuntimeClass::m_lpszClassName before actually saving an object. While loading read the string and create an appropriate instance of the class and serialize it.
Gero
|
|
|
|
|
How to load a pointer into the list using CRuntimeClass name?
|
|
|
|
|
How do you exactly serialize the list currently?
Gero
|
|
|
|
|
just walk all te elements using an iterator and call Serialize() against each element while storing but create a new CEmployee and serialize that and load.
|
|
|
|
|
Then do it like this:
// Storing
for each element in the list
ar.WriteString(object.GetRuntimeClass()->m_lpszClassName);
object.Serialize(ar);
// Loading
CString strType;
CBaseType *pType = NULL;
for number of objects stored in archive
ar.ReadString(strType);
// Check which object was stored based on strType
// and load it
pType = new CStoredType();
((CStoredType *)pType)->Serialize(ar);
// insert (CStoredType *)pType into list
Hope this helps,
Gero
|
|
|
|
|
we all know how to develop a collection of List or Array, i mean: develop real classes of them for using.
but i have no idea how to develop a collection of dictionary or map or bag etc.
i think a dictionary is based on List or Array with key sorted.
is the guess correct? can u give me some clues?
thx
includeh10
|
|
|
|
|
yah,
thats where you begin and later optimise the operations.Ues a map rather then a list of pairs.The map can do all the dirty work for you and do it better in most cases.
Conan
|
|
|
|
|
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
i don't like a reply with no looking and no thinking
includeh10
|
|
|
|