c++

Looking for a C++ open source matrix storage library

The library needs to: record vector or matrices in "frames" (timestamped) enable multiple streams and markers It would be good if the library: had a BSD licence was well documented was written in C++ enabled non-linear access I have found a library that is very interesting and does points (1) and (2): SDIF. But the documentation ...

Passing a file location to an external process using Win32/MFC

Hi all, I'm trying to fulfill a client request here, and I'm not entirely sure I can actually do it. I have an MFC application that relies upon ShellExecute to open files in their appropriate viewer, which spawns multiple viewers if you try to open multiple files one after the other. If you open one .txt document, and then open another,...

Difference between const variable and const type variable

What is the difference between: const variable = 10; and const int variable = 10; Does variable, per the standard, get interpreted as an integral type when no type is defined? ...

Unable to find a .dll in the modules window (VS 2008 C++)

Hi, This is kind of a stupid question I guess, but I have a library which is included and used in a project, compiled as a .dll. Everything compiles fine. When I reach a function in this library, I get System.AccessViolationException and I cannot enter into it while debugging because it says the symbols are not loaded. I have looked in...

How to get the return type of a boost::signal?

I use boost::signal with different function signatures and different combiners. In a class that looks like the one beyond I want to get the return of a certain signal declaration. template<typename signal_type> class MyClass { signal_type mSignal; signal_type::result_type getResult() { return mSignal(); } } But signal_type:...

C++ defining two multimaps causes program to crash

This is utterly mystifying me. I have, in my class declaration, two lines: std::multimap<int, int> commands; std::multimap<std::string, std::string> config; The code compiles without issue, but when I run it, I get the following error: *** glibc detected *** ./antares: free(): invalid pointer: 0xb5ac1b64 *** Seems simple enough, ex...

Can you force unreferenced code to be linked in from a static library?

Here's the scenario - I have created a custom NSView subclass, and the implementation is in a static library. The class is never referenced from the final executable, only from the Interface Builder XML file. Since it's not referenced, it doesn't get included at link time, and as a result the class can't be found at runtime. Is there an...

VS 2008 C++ Debugger works only once

Hello, After a Windows update yesterday, I've run into a terrible problem. The debugger suddenly is creating issues. When I bring up Visual Studio from the start menu, the debugger appears to start, but there is no console window and nothing happens for a long time. But, if I start it from the VS command prompt, it works, but only once...

How you use technique (described) to work with C structures and pointers from .Net?

How you use technique described here to work with C structures from .Net? Ofcourse I need a code example - on 3 parts: C declaring parts, C++ wrapping around C and C# acsessing. So what I wonder Is C structture A has as one of its params structure B which consists of at least 2 types one of which is pointer to some variable C which ...

C++: Cast to an interface that is not part of the base class

I have a series of classes representing "smart" map elements: MapTextElement, MapIconElement, etc. The classes are extending various Qt graphics item classes, but also provide common functionality, such as an abstract factory method that returns a property panel specialized for each class. I have declared these common methods in a pure v...

event filter on QGraphicsItem

Is it possible to have an event filter on a QGraphicsItem? eventfilter has a param that gives you a QObject, but since QGraphicsItem isn't derived from QObject, then how would it work? ...

C++ Game State System.

Okay: I'm fairly new to C++ and static languages on a whole. Coming from years of ruby (and other dynamic languages) I don't know if this is possible. I've been making a game state system for... well a game. I want to make the system easy for me to cut and paste into other games without any (or very few) changes. The two things I am wa...

Setting item height of a list view? (using custom draw)

How can I set the row height of a custom drawn list view? Or does it require an owner drawn list view? ...

Is life-time of local variables in a function, necessarily equal to life-time of that function's execution ?

Possible Duplicate: how does an optimizing c++ compiler reuse stack slot of a function? do c++ compilers have their ways to determine the time at which, life-time of each local variable in a function ends so that they optimize using stack memory, or they simply take it equal to life-time of the function execution ? ...

C++ mutex and const correctness

hello. Is there convention regarding whenever method which is essentially read-only, but has mutex/ lock which may need to be modified, is const or not? if there is not one, what would be disadvantage/bad design if such method is const Thank you ...

Override event handler in C++ Builder

In Codegear C++ Builder, I'm trying to extend the TMemo VCL class to perform some functionality during the OnKeyDown event. I've set up the control and am able to add it to forms and so forth. The problem is that I am unable to capture the OnKeyDown event (or any other event, for that matter). Here is my class: class PACKAGE TREMemoFin...

Detecting precision loss when converting from double to float

I am writing a piece of code in which i have to convert from double to float values. I am using boost::numeric_cast to do this conversion which will alert me of any overflow/underflow. However i am also interested in knowing if that conversion resulted in some precision loss or not. For example double source = 1988.1012; floa...

Design problem relating to manipulating unkown types

Hi, I am stuck with a design problem that I hope you guys can help with. I have a few different classes that have various parameters (more than 20 in each case, and they are mostly different, although some are exactly the same in which case they inherit from a base class). I want to control these parameters through the user of a class c...

OnRButtonDown on a modal dialog

I have a modal dialog that I would like to implement a right mouse click event on. I have added ON_WM_RBUTTONDOWN() to the class's message map. BEGIN_MESSAGE_MAP(MyDialog, CDialog) //{{AFX_MSG_MAP(MyDialog) ON_WM_RBUTTONDOWN() //}}AFX_MSG_MAP END_MESSAGE_MAP() and have overridden the class's afx_msg void OnRButtonDown(UINT...

How read key usage information from x509 certificate using NSS

I'm using nss libraries to read certificates off a smart card/CAC. This is for an app on red hat linux. Bascially I need to get the list of certificates from the CAC and present to the user in a gui (using wxWidgets) allowing the user to pick the certificate to use for authentication. For that, I need to present the certificate list in a...