|
One of my favorite statements was spoken in “theory of information” lecture.
Our elderly professor stated that “ for information to exist, it must be something new, change must be indicated”.
Using this simple definition stating the quality of DirectShow is no longer an information.
The real issue with MS is they just cannot put anything together, mainly because the guy who wrote the first paragraph in this jewel is no longer contracting for them.
I had few “aw s..t” moments with implementing DirectShow, but the worst part is that it is literary scattered in many “SDKs” and for us greenhorns it seldom makes sense.
For example - I ended up rendering the stream and than setting up the display's window.
To me it should be the other way around, but I have not tried that or been successful analyzing why it works that way. And I just hate “it works, but I have no clue why” feelings.
One does not learn much this way , using this “just copy it any pray” approach.
And the other “gripe” - why do so many so called experts write software without using the function / method or whatever COM calls it (!) return values?
Anyway, ISamplerGrabber – here I come.
|
|
|
|
|
Hi ,
I have declared one static fstream file under header.h
static ofstream myfile_logs("D:\\Elec...");
main.cpp
#include "header.h"
int main(...)
{
cal_mem();
verify_data();
}
verify_data()
{
myfile_logs << "verify...";
...
}
//end of main .cpp
commonFunc.cpp
#include "header.h"
void cal_mem()
{
myfile_logs << "calculate Mem";
...
..
}
//end of cal_mem
When i run this program, on opening the log file
i get only
"calculate Mem" text displayed
the control does come to verify_data but the file is not appended or updated with verify.. text
The log file seems to work only for commonFunc.cpp
how to have this log file appended for multiple cpps?
Quite urgent to fix this
Thanks
Anna
|
|
|
|
|
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.
anne_rose wrote: Quite urgent to fix this Urgency is your problem, not ours.
Use the best guess
|
|
|
|
|
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.
Change the header so it looks like this:
extern ofstream myfile_logs;
In a one .cpp file put in this:
ofstream myfile_logs("D:\\Elec...");
Steve
|
|
|
|
|
anne_rose wrote: The log file
Why don't you just use log4cpp?
Or some other existing library?
|
|
|
|
|
i was wondering on how to go to the next tab using only a button...
whats the code for it anyway?
im using visual c++ express
|
|
|
|
|
Patrick G. Spectre wrote: i was wondering on how to go to the next tab using only a button...
The next tab of what?
|
|
|
|
|
the object tabcontrol it has tab pages, i want to switch to those pages by only using a button
|
|
|
|
|
Yeah, but are we talking about the .NET framework tab control?
|
|
|
|
|
|
Yeah I know that. Have you written the control code by yourself or where did you get the tabcontrol from? Have you already a tab control?
|
|
|
|
|
i just started... i dont know how to use the tab control
|
|
|
|
|
What kind of IDE do you use (Visual Studio? QtCreator?)?
|
|
|
|
|
microsoft visual c++ express edition
|
|
|
|
|
|
Why do you want a separate button to do this? Why not just click the desired tab instead?
Of course I may not be understanding, and you may be talking about this instead.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hi guys
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...
Edit: Added "syslog" to the title.
|
|
|
|
|
There are POSIX emulation layers for windows, for example cygwin. Search for cygwin + syslog-ng.
|
|
|
|
|
|
You are welcome. I suggested cygwin just because its popularity but you have options - thats always good! 
|
|
|
|
|
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.
|
|
|
|
|
Hi Albert
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.
modified 19-Mar-13 11:55am.
|
|
|
|
|
At least you have options... 
|
|
|
|
|
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?
|
|
|
|
|