|
Nemanja Trifunovic wrote: What error do you get?
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I don't know the compiler you are using, but it might be that you must "turn on" the support for STL.
In the Acc compiler (on a HP-UX machine), it's done by adding -AA to the command line, both at compile and linking.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I have two selfwritten libraries, one of wich uses the other. If just add the first one to the dependecies of the second one without actually using it or including any of the header-files or anything, i get a
LNK4006: symbol already defined in object; second definition ignored
for every single symbol in the first library. Can anyone tell me why that is and what i can do about it ? I'm allways eager to eliminate all warnings.
|
|
|
|
|
if you make one library dependent on another, VS will merge the the two together so that the second library is contained within the first library.
the fix is: you only need to link to the 'parent' library, since it will have a copy of the second library in it already.
|
|
|
|
|
Thank you for the awnser, but that is not the problem. It seems, for what reason god alone knows, that VC.NET actually links the file twice. I add it to my linker dependencies and look at the command line - everything fine. Now i build, and suddenly the command line changed, so that the library is actually linked twice. Don't ask me why, but thats what it does.
|
|
|
|
|
your original post says "If just add the first one to the dependecies of the second one without actually using it..."
if you make library A depend on library B, the .LIB for library A will contain the .LIB for library B. you don't have to explicitly link library B at all. but, i repeat myself.
Mr.Brainley wrote: suddenly the command line changed, so that the library is actually linked twice
what does the command line look like?
|
|
|
|
|
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 :.
|
|
|
|