We have a C++ MFC application (SLOC is ~200000 if it matters). It was written very quickly during the dot-com era with little thought given to extensibility or scalability. In the intervening time, it's become a mission critical product that we distribute to customers.
Right now, we have two great developers maintaining the codebase, b...
I am writing a library in C++ and have some functions that work with modules. An example would look like this:
void connect(Module *a, Module *b);
The problem is, that it would be sometimes handy if the function accepted also references (some of the Modules may be allocated on the stack and some on the heap and all the &s and *s get b...
Are their any libraries similar to mono but for the c++ language? I know boost exist but i like mono much more then boost.
-edit-
I'm looking to do more. Like play sound easier (crossplatform), GUI, load image, time, etc. I guess i am looking for what people might consider an engine or a large library.
...
Hey, I've been writing a program (a sort of e-Book viewing type thing) and it loads text files from a folder within the folder of which the executable is located. This gives me a bit of a problem since if I run the program from another directory with the command "./folder/folder/program" for example, my program will not find the text, be...
I need to map a pair of long long to a double, but I'm not sure what hash function to use. Each pair may consist of any two numbers, although in practice they will usually be numbers between 0 and about 100 (but again, that's not guaranteed).
Here is the tr1::unordered_map documentation. I started like this:
typedef long long Int;
type...
The scenario is such: there's a program which loads my .dll/.so and calls a function from within it, possibly multiple times, each time expecting a different pointer to state. It uses the different states later in other calls into the dll. (It's a game AI, if you need context; each state is a AI player.)
What I want is a cross-platform ...
Update: This issue is caused by bad memory usage, see solution at the bottom.
Here's some semi-pseudo code:
class ClassA
{
public:
virtual void VirtualFunction();
void SomeFunction();
}
class ClassB : public ClassA
{
public:
void VirtualFunction();
}
void ClassA::VirtualFunction()
{
// Intentionally empty (code sm...
I am working on a project where I need to embed a web server into my C++ application. I am looking for an open-source library supporting SSL, written in C or C++ and with a licensing scheme that will allow me to link it into my existing closed source code. Any suggestions of specific products or where to look first?
...
Hi all:
I am writing a framework for an embedded device which has the ability to run multiple applications. When switching between apps how can I ensure that the state of my current application is cleaned up correctly? For example, say I am running through an intensive loop in one application and a request is made to run a second app ...
Hi, I have created a wn32 project with Visual Studio 2008 and Visual C++ language, it uses the ws2_32.lib library and then I compiled in Release mode.
It runs very good in the same computer, but when I copy the exe file to other computer (that doesn't have installed Visual Studio), it doesn't run.
The message I see is:
This applicati...
Hi,
Is there any c function that allow me to convert a raw image to a PNG file?
Preferably, I don't need to pull in a big library for that.
Thank you.
...
Hello,
I need help on global variable usage in an ActiveX(ATL) project. Basically the ActiveX component function is to navigae to a specified URL in composite control(webbrowser embedded). The URL string is initialize in the beginning and saved in a global variable. here is my source code file of ActiveX project.
(Do not be concerne...
Hi all:
I am writing a library of utility classes, many of which are singletons. I have implemented them as such using inheritance:
template <class T>
class Singleton {
public:
T& getInstance() {
if(m_instance == 0) {
m_instance = new T;
}
return m_instance;
}
...
I want my program to search wikipedia and get the info it searches for and put it into a large string and output into a file. How can I do that in C++? Any info please tell? need more anwsers please
...
There was some code like this:
// Convenience to make things more legible in the following code
const float & x = some.buried.variable.elsewhere;
// Go on to use x in calculations...
I have been told that the "const float &" is "bad" and should just be a plain float or const float.
I, however, could not think of a compelling reason ...
Why are most priority/heap queues implemented as 0 being the highest priority? I'm assuming I'm missing out some key mathematical principle. As I was implementing my own priority queue recently it seemed easier to write the insert function if priority went up with the integer value, but apparently people smarter than me think it should g...
Hi,
I have an array of raw rgb data on a 16 bit display with dimension of 320 * 480. The size of the array is 320*480*4 = 6144000.
I would like to know how can I scale this down (80 * 120) without losing image quality?
I found this link about scaling image in 2D array, but how can I apply that to my array of 16 bit display? It is not ...
Hello, I have a problem which is most likely a simple problem, but neverthe less still a problem for me. I am using the Listbox in Win32 / C++ and when getting the selected text from my listbox the string returned is just garbage. It is a handle to a struct or similar?
Below is the code and an example of what I get.
std::string Listbox...
I know that I can kick the the preprocessor to spit out output with the -E option in my particular circumstance. For generated code this preprocessor output is murderous. For example I have a 4gl application and Informix converts this into C which in turn gets spit out to a horrible ugly mess.
What I want is an editor that will allow ...
I have a very large HTML file (several megabytes). I know the data I want is under something like <div class=someName>here</div>
What is a good library to parse through the HTML page so I can loop through elements and grab each someName? I want to do this in either C#, Python or C++.
...