c++

Extend the Visual Studio C++ Build Process

A found an article (Extend the Visual Studio Build Process) that explained how to override build targets in a C# project file. I tested this, and it seems to work well. However, what I really want to do is override a build target in a C++ project (with Visual Studio 2005). The problem is that C++ projects use different XML. Instead o...

Data range filters in C++

I want to allow the user to be able to define ranges that will filter data. The ranges defined could be contiguous, over lapping, or separated (e.g. the user enters the following ranges: 1-10, 5-10, 10-12, 7-13, and 15-20). I then want to filter the data so that the user is only displayed what is within those ranges. I will probably cr...

Windows Mobile Native Code - jstring to LPCTSTR

I have a Java app which needs to interact with the camera on a Windows Mobile device. I have written the Java Code and the Native code and it all works fine. The problem I am having now is that I want to start passing variables from Java to the Native code, e.g. the directory and file name to use for the photo. The native code uses a ...

requiring msvcr80.dll and msvcr80d.dll in the same dll?

how can it be that a dll that i build here (in debug mode) tries to load msvcr80.dll and msvcr80d.dll ... i assume this leads then to a conflict as it can resolve the same symbols twice ... i have no idea why the dependency to msvcr80.dll comes in. according to dependency walker ouput the dependency comes directly from my dll and not vi...

Reading single byte with Asio::read

Hi. Is it possible to read a single byte via asio::read? I'm getting a single byte response and it seems wasteful to use the current buffering code: //Read the 1 byte reply char buffer[1]; size_t bytesRead = asio::read(s, asio::buffer(buffer, 1)); if(bytesRead < 1) return false; Thanks. ...

How to get handles to all windows of another application

Hi, in my application i have timer, in TimerProc i want to get handles of all windows(main and child) of the another application that has focus. I have no idea how to do that because i don't understand functions like GetNextWindow or GetParent and Z-oder of windows and i can't find anywhere very detailed explanation of how this functions...

Building C++ CLR app for Platform Toolset v90 in VS2010 requires Visual Studio 2008

I've got a shiny new laptop with the latest Dev tools installed such as Visual Studio 2010. Now I've got a task to build a C++ CLR app targeting the 2.0 runtime (this is well outside my comfort zone). So I've specifed the v90 Platform Toolset but when I build I get:- error MSB8010: Specified platform toolset (v90) requires Visual S...

Segfault on using transform on a vector of pointers to an abstract class

I experience a segfault on the following code: I have an abstract class A with a method virtual bool Ok() const; Now, I have the following vector std::vector<A*> v; filled with several pointers to existing child objects. I want to accumulate the results of the Ok() method as follows: std::vector<bool> results; std::transform(v.be...

Set an icon for a file type

I have used Qt Creator and created my.exe file and a new extension ".newext" and have manually associated .newext files to the my.exe like this. The exe file has as its icon which is square figure and named myIcon.ico. I have described in myapp.rc file the icon like this: IDI_ICON1 ICON DISCARDABLE "myIcon.ico" A...

Why might ProcessMessages throw a C++ Exception?

While maintaining an old product, I came across an error that results in the screen being filled up with hundreds of message boxes saying 'C++ Exception' and nothing else. I traced the problem to the following line: Application->ProcessMessages(); I understand the purpose of this line, to process all the messages in the message queue...

"case sequence" in python implemented with dictionaries

i have implemented a function: def postback(i,user,tval): """functie ce posteaza raspunsul bazei de date;stringul din mesaj tb sa fie mai mic de 140 de caractere""" result = { 1:api.PostDirectMessage(user,'Trebuie sa-mi spui si marca pe care o cauti'), 2:postmarket(user,tval), 3:api.PostDirectMessage(use...

Is there a way to detect when all child items within a QTreeWidgetItem have been marked 'hidden'?

Is there a preferred way to detect when all of a QTreeWidgetItem's children are marked as hidden? Currently, I'm iterating over all of them every time any of them are hidden. ...

How to understand everything regarding a Simple Program creation?

I have referred quite a few books on C, C++, etc. in fact i have even read the Dragon book on Compilers. But my basic doubt remains, is there any link or book i can read which explains a simple C program creating from writing source code in a Editor to Compilation to Linking? Would appreciate an internet link is provided. ...

virtual desctructor on pure abstract base class

I have struct IMyInterface { virtual method1() = 0; virtual method2() = 0; }; GCC insists that I have struct IMyInterface { virtual method1() = 0; virtual method2() = 0; virtual ~IMyInterface(){}; }; I dont see why. A pure interface is all about the interface (duh). The destructor is part of the internal implementati...

Using QtMobility/Location, a Symbian Qt C++ application runs in emulator but not on device.

I have a Symbian Qt C++ mobile application that runs fine in the emulator but when the application is compiled into a SIS file and installed on the phone, it installs successfully but does not start and fails silently without any message. The application uses QtMobility 1.0.1 to access the Location API. ...

Any improvements over my linked-list method?

I am continually writing a program to improve my knowledge of linked-lists and how they function. I was wondering if some of you could review my code and notice any faults that you may be familiar with, or any errors in general. The functions work for my test functions, but obviously, I have not tested every scenario possible. // Li...

Problem in writing wstring to a file for hebrew/arabic language

I want to read hebrew(unicode) using xerces parser. I am able to read the value in XMLCh. However, while writing it to another file I get gargabe value. I tried using ofstream, wofstream but didnot helped. Let me know your suggestions ...

Testing a c++ class for features

I have a set of classes that describe a set of logical boxes that can hold things and do things to them. I have struct IBox // all boxes do these { .... } struct IBoxCanDoX // the power to do X { void x(); } struct IBoxCanDoY // the power to do Y { void y(); } I wonder what is the 'best' or maybe its just 'favorite' idio...

Stop VC++ from pointing at errors in files outside my project?

Is there any way to make VC++ 2010 trace errors back to the last line that was called INSIDE my project? I don't know why they did it, but its completely useless when VC++ tells me that the error is inside one of the standard classes rather than which line in my project actually led to that error. ...

I'm about to open source a C++ project on Sourceforge. Can I get some tips on code organization?

I'm about to upload a project I've been working on onto Sourceforge under the GPL, and was hoping to get some advice on how to organize the code in a fashion that is easy to understand and use by any developers that might look at it, that works well with git, and the way Sourceforge presents things. My projects is a cross-platform C++ a...