I'm trying to use the ACE_Service_Object or the ACE_Shared_Object. I'm not sure which one is applicable. I'm trying to encapsulate some functionality in a DLL so a consumer of the DLL would open the library, create an instance of the exported class, call some functions on the class, and then destroy the class. A basic plug-in architec...
I'm looking for a way to monitor which processes are using (or attempting to access) a file over a duration of time. What are some good Windows APIs or tools to achieve this?
...
I want my BHO to listen to onmousedown event of some element in a certain webpage.
I have all the code that find the specific element, and in msdn its says that I need to use the get_onmousedown event. I came up with this code.
CComQIPtr<IHTMLElement> someElement;
VARIANT mouse_eve;
someElement->get_onmousedown(&mouse_eve);
The que...
Does anyone know how to modify the thread scheduling (specifically affinity) when using TBB? Doing a high level analysis on a simple parallel-for application, it seems like TBB is specifying the underlying threads' affinity in a way that reduces performance. Specifically, the cores I'm running on have hyper-threading enabled, and it lo...
It seems that a constructor that takes a non-const reference to an istream cannot be constructed with a temporary value in C++.
#include <iostream>
#include <sstream>
using namespace std;
class Bar
{
public:
explicit Bar(std::istream& is) {}
};
int main()
{
istringstream stream1("bar1");
Bar bar1(stream1); // OK on all platf...
I have a single xml file and every new thread of the program (BHO) is using the same Tinyxml file.
every time a new window is open in the program, it runs this code:
const char * xmlFileName = "C:\\browsarityXml.xml";
TiXmlDocument doc(xmlFileName);
doc.LoadFile();
//some new lines in the xml.. and than save:
doc.SaveFile(xmlFileName);...
Hi,
I have kept hearing this statement. Switch..Case is Evil for code maintenance, but it provides better performance(since compiler can inline stuffs etc..). Virtual functions are very good for code maintenance, but they incur a performance penalty of two pointer indirections.
Say i have a base class with 2 subclasses(X and Y) and ...
I have a list of items that I need to update on different intervals. The list can grow to be thousands of items long. Each item could potentially have a different interval. If I create one timer per item, am I going to saturate the system with threads? I was thinking it might be better to create one timer equal to the smallest interval i...
the second function gives error C2803 http://msdn.microsoft.com/en-us/library/zy7kx46x%28VS.80%29.aspx : 'operator ,' must have at least one formal parameter of class type. any clue?
template<class T,class A = std::allocator<T>>
class Sequence : public std::vector<T,A> {
public:
Sequence<T,A>& operator,(const T& a) {
this-...
I want to allow a user to drag my Win32 window around only inside the working area of the desktop. In other words, they shouldn't be able to have any part of the window extend outside the monitor(s) nor should the window overlap the taskbar.
I'd like to do it in a way that does cause any stuttering. Handling WM_MOVE messages and calling...
I want to manipulate .zip and .rar files from C++. What libraries should I use?
...
I am looking for a cross platform Library in C++ that can run a web server.
Does any one know if tntnet can work on windows computers.
or libmicrohttpd
...
I need to create a function that uses a loop. This function will open a text file and then must be able to skip a variable number of leading random integers. The program must be able to handle any number of leading random integers.
Example if the opened file reads this on its first line:
100 120 92 82 38 49 102
and the SKIP_NUMBER va...
Suppose I have a class A which depends on 3 other classes X, Y and Z, either A uses these through a reference or a pointer or say A is templated to be instantiated with X, Y and Z doesn't matter, the key is that in order to test A, I need to have X, Y and Z.
So I need to have fakes for A, B and C. Suppose I write them. Now, how do I sw...
I'm using SWIG to wrap C++ objects for use in lua, and Im trying to pass data to a method in my lua script, but it always comes out as 'nil'
void CTestAI::UnitCreated(IUnit* unit){
lua_getglobal(L, "ai");
lua_getfield(L, -1, "UnitCreated");
swig_module_info *module = SWIG_GetModule( L );
swig_type_info *type = SWIG_TypeQ...
I realize this is a basic question but I have searched online, been to cplusplus.com, read through my book, and I can't seem to grasp the concept of overloaded operators. A specific example from cplusplus.com is:
// vectors: overloading operators example
#include <iostream>
using namespace std;
class CVector {
public:
int x,y;
...
Looking at the main function, we can see that I've Hard Coded the "Monday" into my setDay public function. It is easy to grab a day of the week from the user using a c-string (as I did in setDay), but how would I ask the user to add n to the day that is set, "Monday" and come up with "Thursday"? It is hard because typdef enum { INVALID, ...
I want to make an application in c or c++ which have to monitor some specific processes. Kindly guide me how I can make it possible in c.
...
I'm wondering, for no other purpose than pure curiosity (because no one SHOULD EVER write code like this!) about how the behavior of RAII meshes with the use of Goto (lovely idea isn't it).
class Two
{
public:
~Two()
{
printf("2,");
}
};
class Ghost
{
public:
~Ghost()
{
printf(" BOO! ");
}
};
vo...
Does it make any sense of declaring objects or refrences in a destructor of a class in C++?
I mean
class A
{
A()
{
}
~A()
{
//Declaring refrences or objects here //
}
}
...