|
Ok, i was unclear there. By "add to dependencies" i meant explicitly linking it. I added the filename in the "Additional dependencies" column of the linker options in the project properties.
But i solved the problem now ... somehow. I gave VC a relative path to .lib-file. That was the problem. He put that path into the LIBPATH commandline-option, added the filename to the files to be linked, and then added the filename plus the absolute path to the files to be linked, so it was in there twice. Nice, eh ? I now added an absolute path to my projects properties instead of the relative one, and it works. Who'd have guessed ...
|
|
|
|
|
I was wondering how I could make a log of what programs is being launched in my computer.
I have two things in my mind:
1) Making a "shortcut to the most recently used programs"-program. This program should give me an overview of what programs have been the 15 last started programs so that I can click on that program and it will be launched again (kinda like a quick-launch, only less static)
This should log programs that are started throught the "start->run" menu, a shortcut anywhere on my computer or from a command line interface. It would also be nice to have any parameters to the program included.
2) Log what actually goes on in my computer.
I have been thinking about systemwide hooks but not sure if this is the way to go.
Should I instead hook APIs, in this case, which?
I want to do this in C++.
Can anyone guide me into a correct direction?
Edit: I assume this might be something..
http://www.codeproject.com/system/soviet_protector.asp[^]
-- modified at 9:36 Monday 23rd October, 2006
|
|
|
|
|
I had a task similar to this one a while back. After much wrangling with various techniques I settled on a system wide hook. It worked a charm and stories of massive degradation of the system's performance seemed to be woefully exaggerated. Not only that but I've never had a problem with it since and it's been out in the field for four years now.
However, if you've never used them before do some good research on the issues related to shared memory. It's not complicated but if your trying to feel your way about without the theory it's fiddly and error prone.
There is another good technique but it requires a DDK for each of the systems your aiming at. In the DDK you get access to kernel events and of course these can give you a very accurate and specific view of what's going on.
Sorry, I don't know much about hooking APIs.
Tom
|
|
|
|
|
Could you please be more specific about what type of hook you set up? (keyboard or mouse or something else)
I have dabbled with both systemwide hooks (keyboard + mouse) and also some api-hooking but the latter is also a much more harder topic to go with
I assume both a mouse or keyboard hook will come into the process space of a gui program but what about console-like programs?
Thanks for you reply
|
|
|
|
|
Hi
Personally, I used WH_SHELL and paid particular attention to HSHELL_WINDOWCREATED and HSHELL_WINDOWDESTROYED messages. I then posted them onto a window in my app.
Tom
|
|
|
|
|
Nice, thanks for the info. I'll try this out
|
|
|
|
|
can anybody tell me what framework are you guys using? is it MFC from microsoft? or any other?
|
|
|
|
|
If you want to stay unmanaged, MFC has the huge benefit of the assembled knowledge here, on other pages and at MSDN.
But if you want to be platform independend, I would recommend wxWidgets[^]
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I am programming an application in which I have created a private thread, so I want to know how to manege the thread, for instance: when is the thread active or inactive. I really need the information.
duc an
|
|
|
|
|
Pham duc an wrote: I want to know how to manege the thread
HI.
A very good thread-managing-library ist the one from boost.org: boost-threads[^]
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hey good people.
I was wondering if anyone cud help me work with the month calendar.
My program is to perfrom certain task based on the date selected by the user
but i dont know how to retrieve the date and what format it is in.
Please help
Phoenix
|
|
|
|
|
If this is using MFC, have you looked at the CMonthCalCtrl methods?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I am getting this error when I try to run my app in debug.
Unhandled exception - debug.exe MFC42D.DLL 0xC0000005: Access Violation
It wont run in release mode either. I have checked that my project settings are in debug and its ok. I have heard this is quite a nasty error The thing is my application worked fine the day before. I really dont understand why this has happened . I thought it might be the registry ? If anyone can put forward any ideas I would be most grateful.
Thank you.
|
|
|
|
|
minkowski wrote: 0xC0000005: Access Violation
Someone, somewhere is trying to dereference a NULL-Pointer.
You need to find the place where. Set breakpoint in your program, and when you found one before the crash use step execution to wherever the crash occurs.
The find out what is going on and fix it.
Sorry, but I can't help you more without knowing what is happening in your program.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Simply running your application under the debugger should help, it will tell you where the access violation is.
Darka [ Xanya]
"I am not a slave to a god that doesn't exist."
|
|
|
|
|
Ok thank you! I will try that !
|
|
|
|
|
Hi, All
I want to change some text of Menu item on runtime.
i had changed submenu text, now i want to change text of menu, ect: File, View, Edit
Please, adv me.
Huynhnb
.: Your success is also mine :.
|
|
|
|
|
I had solved.
CMenu *pMenu = GetMenu();
// Change main menu
pMenu->ModifyMenu(0, MF_BYPOSITION | MF_STRING, 0, _T("New Item 1"));
pMenu->ModifyMenu(1, MF_BYPOSITION | MF_STRING, 1, _T("New Item 2"));
pMenu->ModifyMenu(2, MF_BYPOSITION | MF_STRING, 2, _T("New Item 3"));
Huynhnb
.: Your success is also mine :.
|
|
|
|
|
hi all,
when i'm returning a value from a try block of function, control is jumping in to
catch block.
thanks in advance.
Regards,
Prashanth
-- modified at 5:32 Monday 23rd October, 2006
|
|
|
|
|
voorugonda prashanth wrote: returning a value from a try block of function, control is jumping in to catch block.
Being not a prophete, I can only speculate that you are live-experincing the chatching of an exception.
Otherwise, show some (reduced!) source.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Try a "Rebuild all". It might help.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hi
I have a class that I use for logging events in my applications, which are normally left running all day and year. The class generates txt files of the name :
app_name(YYYY_MM_DD).txt
and is designed to delete files that are a month old eg todays date is the 20/10/2006, so it will delete the 20/09/2006.
Occasionally the program may not be running for a few days. In this case the class does not delete the files that were generated a month ago - i.e. if the app was not running yesterday (the 19th), the log generated on 19/09/2006 would not be deleted.
Is there a simple way round this?
Can you use wild cards some how - for instance delete all files from 09/2006 at the start of 11/2006?
Thansk for any advice
69 Bay
|
|
|
|
|
If you are using MFC, just calculate the difference using COleDateTimeSpan . If GetTotalDays() returns 30 or more for any file encountered, delete it.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks David
I am using MFC - how do I get a list of all the files that are currently in a folder? I assume I would have to do this, and then go through each file and do as you suggest.
Thanks for helping
69 Bay
|
|
|
|