You have created two separate streams, one in main.cpp and one in commonFunc.cpp. Even though they both use the same filename they will not be synchronised. You should create a function that manages the file and does all the logging, and call that from the other parts of your program.
The static doesn't do what you're assuming. In a class it makes it "global" (shared by all instances) but at namespace scope it makes the variable private to the compilation unit. Every file that includes your header has it's own stream.
I am looking for a C++ library like syslog-ng[^] but with the possibility to run under Windows (syslog-ng needs a POSIX system ). Has anyone an idea or a suggestion? Not required anymore, I simply took a hour-long Google search on me and made my Windows POSIX-compatible [^] . Since syslog-ng needs POSIX I suppose it will run well and smooth...
FYI... if you're required to export your application to end users, Cygwin might still be an easier option. You may be surprised at the number of commercial applications that rely on Cygwin to run on Windows.
thank you for the information, but I am talking about the controller software of this medical diagnostics instrument[^] (pointed that not well enough out, sorry). Because of the regulations in the market we are going to do a hardening process on the OS anyways and can set up the image anyway we want to, so installing the kernel patch is no problem since we decide what the customers OS will look like. And using the kernel patch we get a faster response time anyways, so this is the way to go for us. But thank you very much for the additional info.
hello i am trying to write a program that counts the no. of records in a file by placing the get pointer at the end of file and using tellg() function to get the pointer position and dividing the no. of bytes with the size of one record to get the no. of total records
but when i write file.seekg(0,ios::end); and then inquire the position of get pointer file.tellg(); the result that i am getting is -1. please tell me what am i doing wrong?
Take a look at Microsofts public symbol server. You can download symbols for all their code from it, and set breakpoints and so on.
You can speciyf these sylbols in VS and when it tries to load downloads them automatically. I use windbg though so I cant help you much more than that, and I work in the kernel, but if you choose to do the same this is a usefull command:
bp nt!ntcreatefile "dt nt!_UNICODE_STRING poi(poi(@esp+0xc)+0x8)"
It sets a break point on createfile (this is what CreateFile maps to in the kernel) and displays the file being opened (This is 32 bit, if it was 64 the parameter would be in a register not on the stack).
SO any user mode acces to creatfile you can break on and have a wander arond the stack and see whats doing what.
Or as the poster above says, set the bp in the usermode dll.
I can deffinitely recomend using windbg, it is a hell of a debugger, everyone in microsoft uses it, VS is a toy in comparison.
My system is win7 64Bit I use the VS2008 to compile the chrome solution. But I meet some problem about compile the FFMPEG. I google that the others are all ok when compiling, but I have bad luck. I donot know why some error happen. Does anyone meet the same problems?