c++

Selecting an index in a QListView

This might be a stupid question, but I can't for the life of me figure out how to select the row of a given index in a QListView. QAbstractItemView , QListView's parent has a setCurrentIndex(const QModelIndex &index). The problem is, I can't construct a QModelIndex with the row number I want since the row and column field of the QModelI...

Is that a good idea to define exception with template?

Hi, I am thinking is that a good idea to define exception with template. Defining different types of exception is a super verbose task. You have to inherit exception, there is nothing changed, just inherit. Like this.. class FooException : public BaseException { public: ... }; class BarException : public BaseException { public: ...

Destructor vs member function race

When I'm inside a destructor is it possible that some other thread will start executing object's member function? How to deal with this situation? ...

Launching a C++ executable from a C# app and keeping role based security context

Hi all, First off I know this is probably a tall order but... :) We have some software that interacts with the hardware our company produces. This software loads a .NET assembly and this acts as our interface to the hardware. Currently we have a 'Launcher' application written in C# which provides role based security. This 'Launcher' ...

error: ‘NULL’ was not declared in this scope

I get this message when compiling C++ on gcc 4.3 error: ‘NULL’ was not declared in this scope It appears and disappears and I don't know why. Why? Thanks. ...

Why doesn't C++ have a pointer to member function type ?

I could be totally wrong here, but as I understand it, C++ doesn't really have a native "pointer to member function" type. I know you can do tricks with Boost and mem_fun etc. But why did the designers of C++ decide not to have a 64-bit pointer containing a pointer to the function and a pointer to the object, for example? What I mean s...

Open source minimal web server?

I am thinking of the next steps for a project I have written. It is currently a desktop application that controls a serial port device. I am considering allowing browser clients to connect to some process to get "near real time" updates about the state, etc of the device. Possibly also allowing control from a browser client. I'd ra...

Using static vs. member find method on a STL set?

I am using a set because, i want to use the quick look up property of a sorted container such as a set. I am wondering if I have to use the find member method to get the benefit of a sorted container, or can I also use the static find method in the STL algorithms? My hunch is that using the static version will use a linear search inste...

Client won't talk to ATL Service

I'm having a problem with an ATL Service that exports a COM object. It works running as a local service, but when running as a Windows Service, I can't connect. The service starts correctly and runs, but my client (code below) always fails with the error "Failed to start service". So we're looking at the same thing, I've put together a ...

String.Format for C++

Looking for an implementation for C++ of a function like .NET's String.Format. Obviously there is printf and it's varieties, but I'm looking for something that is positional as in: String.Format("Hi there {0}. You are {1} years old. How does it feel to be {1}?", name, age); This is needed because we're going to try and make ...

C++ Library for image recognition: images containing words to string

Does anyone know of a c++ library for taking an image and performing image recognition on it such that it can find letters based on a given font and/or font height? Even one that doesn't let you select a font would be nice (eg: readLetters(Image image). ...

There is really something like Objective C++?

I'm reading a post about iPhone programming and I've noticed that the talk about Objective C++, the code shown in the post looks mainly like Objective-C but there also are several snippets in C++. Is it really possible to program Cocoa from C++? ...

Putting a CGImageRef on the clipboard

I'm trying to copy a CGImageRef to the clipboard pasteboard. I found a function that claims it should do this by creating a destination from (zero sized), adding the image to the destination, finalizing, then PasteboardPutItemFlavor the ref into the clipboard. However it doesn't work, so two questions: Is this the correct way to go ab...

[Visual C++ 6 - MFC] How can I get and set the 'read-only' property of an edit box?

How can I get and set the 'read-only' property of an edit box? ...

c/c++ FFT library with non GPL license

I am looking for a FFT library with a license that allow me to include it in a commercial C++ software. Free would be nice. (Intel IPPS is 199$ per head, which is a bit expensive for the number of developper that will be compiling it.) Anybody has good experience with such a FFT library? I found this page, which list a lot of librari...

What is the best way to pass information from java to c++?

I have a java application I need to pass some info to a C++ program. It has been suggested that I use some simple socket programming to do this. Is this the best way? If not what are the alternatives? If so, how should I go about learning about socket programming? ...

xdrawstring not working

Hi, I am using xdrawstring on solaris 10 as well as sunos 2.6. I am drawing everything to pixmap and then outputting the final pixmap. The method works on older version but on newer version it doesn't seem to work showing nothing as text. Best regards, RUI ...

As a Java developer, C or C++?

I've been writing Java professionally for the last 5 years. Recently, I've had to dig into JNI a bit to call some Windows specific functions. This experience has highlighted my poor command of the C (or C++ for that matter) language. My only introduction to C was a brief "dummies" book that I read in high school 11 years ago. I know ...

Wireless debugging of windows mobile applications

I'm trying to debug a windows mobile aplication using a wifi connection, on a Vista with Visual Studio 2008 following this instruction http://blogs.msdn.com/vsdteam/archive/2005/04/28/413304.aspx. It worked flawlessly with XP SP2, but not with Vista. Do you know if this is possible at all? or is another flaw from Vista? ...

Simple Dynamic Graph Display for C++

I am looking for a simple graph layout library for C++. I want to embed the library into our visualizer based on wxWidgets. In summary, I am looking for something like graphviz, except dynamic - that is when an event occurs, only the change in graph needs to be loaded, not the complete display. There is dynagraph, but it seems a dead pro...