The subject says it all - normally easy and cross platform way is to poll, intelligently. But every OS has some means to notify without polling. Is it possible in a reasonably cross platform way? (I only really care about Windows and Linux, but I use mac, so I thought posix may help?)
...
What method do you use when you want to get performance data about specific code paths?
...
Knowing an exception code, is there a way to find out more about what the actual exception that was thrown means?
My exception in question:
0x64487347
Exception address: 0x1
The call stack shows no information.
I'm reviewing a .dmp of a crash and not actually debugging in Visual Studio.
...
I have a counter in hardware that I can observe for timing considerations. It counts miliseconds and is stored in a 16 bit unsigned value. How do I safely check if a timer value has passed a certain time and safely handle the inevitable rollover:
//this is a bit contrived, but it illustrates what I'm trying to do
const uint16_t print_in...
Does anybody know how to get local path of file cached by Firefox based on its URL from an XPCOM component?
...
with all the fuss about opensource projects, how come there is still not a strong standard that enables you to make portable code (i mean in C/C++ not java or c#)
everyone is kind of making it's own soup.
there are even some third party libs like Apache Portable Runtime.
...
I'm trying to create a dialog box using C++ and the windows API, but I don't want the dialog defined in a resource file. I can't find anything good on this on the web, none of the examples I've read seem to define the dialog programmatically.
Anyone know how to do this? A simple example is fine, I'm not doing anything complicated with i...
How do I use the profiler in Visual Studio 2008?
I know theres a build option in Config Properties -> Linker -> Advanced -> Profile (/PROFILE), however I can't find anything about actauly using it, only articles I was able to find appear to only apply to older versions of Visual Studio (eg most say to goto Build->Profile to bring up the...
I need to create a 2D int array of size 800x800. But doing so creates a stack overflow (ha ha).
I'm new to C++, so should I do something like a vector of vectors? And just encapsulate the 2d array into a class?
Specifically, this array is my zbuffer in a graphics program. I need to store a z value for every pixel on the screen (henc...
Hi,
I'm looking for a control that the Visual Studio "Toolbox" menu uses. It can be docked and can retract (pin).
Would you know where I can find a control or COM I could use which would look like this?
...
std::vector<int> ints;
// ... fill ints with random values
for(std::vector<int>::iterator it = ints.begin(); it != ints.end(); )
{
if(*it < 10)
{
*it = ints.back();
ints.pop_back();
continue;
}
it++;
}
This code is not working because when pop_back() is called, the it is invalidate. But I don't...
What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008?
The main reason for asking such a question is that there are still many decent programmers that prefer using the older version instead of the newest version.
Is there any reason the might prefer the older over the new?
...
We are developing a middleware SDK, both in C++ and Java to be used as a library/DLL by, for example, game developers, animation software developers, Avatar developers to enhance their products.
What I would like to know is this: Are there standard "Best Practices" for the development of these types of API?
I am thinking in terms of us...
I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate calling process with help of LogonUser like this:
//all variables are ini...
Hi,
I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using pointer arithmetic / dynamic memory allocation, or, alternatively using STL techniques such as vectors.
Essentially I want my integer array dimensions to look like:
[ x ][ y ][ z ]
x and y are in the range 20-6000
z is known and ...
I'm considering dumping boost as a dependency... atm the only thing that I really need is shared_ptr<>, and I can get that from std::tr1, available in gcc suite 4.*
...
Hi,
I need to determine when my Qt 4.4.1 application receives focus.
I have come up with 2 possible solutions, but they both don’t work exactly as I would like.
In the first possible solution, I connect the focusChanged() signal from qApp to a SLOT. In the slot I check the ‘old’ pointer. If it ‘0’, then I know we’ve switched to this...
I use RCF with boost.serialization (why use RCF's copy when we already use the original?) It works OK, but when an exception is thrown in the server, it's not passed correctly to the client. Instead, I get an RCF::SerializationException quoting an archive_exception saying "class name too long". When I change the protocol to BsText, the e...
I would like to monitor a log file that is being written to by an application. I want to process the file line by line as, or shortly after, it is written. I have not found a way of detecting that a file has been extended after reaching eof.
The code needs to work on Mac and PC, and can be in any language, though I am most familiar with...
Is there a way to utilise the GCC compiler whilst still being able to develop via the Visual Studio IDE?
Our project is cross-platform, and I quite frequently get into trouble from my colleague because I'm checking in code that's not standards compliant (this can be attributed to the VS compiler!).
I'd still like to be able to compil...