c++

Visual C++ - Why bother with Debug Mode?

So I have just followed the advice in enabling debug symbols for Release mode and after enabling debug symbols, disabling optimization and finding that break-points do work if symbols are complied with a release mode, I find myself wondering... Isn't the purpose of Debug mode to help you to find bugs? Why bother with Debug mode if it l...

Best approach for common functionality

Hi, I have built up a number of common modules which I have been hitherto keeping in one directory and referencing from the project directories that need them. I was wondering if there was a better way of doing this ? Both the common modules and the code using them are written in C++. ...

How to get print preview of webpage in smartphone application.

Hi, how to get an print preview content of an webpage using HTML control or web-browser control in windows mobile smart phone application using c#, c++ or ATL control. please guide us with any technical detail or any sample application associated with it. -Thanks in advance. GrabIt ...

WinForms or WPF or Qt for Windows GUI with C/C++ as backend

I am to develop an application on windows. I have never done that before ;-) I need to do some heavy audio calculation, which has to be written in C/C++. This part will be a room correction algorithm which currently takes about 10 seconds per channel to run in Matlab. It has to be written in C/C++, since it might be ported to a DSP late...

QT Application Performance vs. WinAPI/MFC/WTL/...

I'm considering writing a new Windows GUI app, where one of the requirements is that the app must be very responsive, quick to load, and have a light memory footprint. I've used WTL for previous apps I've built with this type of requirement, but as I use .NET all the time in my day job WTL is getting more and more painful to go back to....

How to use boost::lambda together with std::find_if?

I have a std::vector and I want to check a specific attribute of each element. SomeStruct has an attribute 'type'. I want to check this attribute to be either Type1 or Type2. My plan is to use boost::lambda. std::vector<SomeStruct>::const_iterator it = std::find_if(vec.begin(), vec.end(), _1.type == SomeStruct::Type1 || _1.type == Some...

virtual data type/enum

Hello, I want a virtual class like this: class Configuration { public: enum EPromptId; virtual CString getPrompt( EPromptId promptId ) = 0; private: }; So that each derived configuration can have its own set of EPromptIds class Configuration1 : public Configuration { public: enum EPromptId{ epid_HappyBirthday ...

C++ game and decorator pattern

I'm porting a 2D platformer and I need a good way of getting some extensibility out of my level tiles. I'm not sure if Decorator is correct here, but nothing else comes to mind. Maybe I need something unique. Anyway, say I have a basic Tile that has things like it's image, and whether the player can pass through it (background or foregr...

Need help attaching gdb to my project

I use VS2k8 to write and compile (but not run) a program using the MPICH2 libraries on Vista x64. I then use mpiexec from the command line to launch the program (with only 1 process for the purposes of debugging), and I'd like to attach gdb to it. Simply using attach or gdb --pid=### doesn't work (I get the error Can't attach to process)...

how to prioritize user define messages in a thread?

I have an only one thread (Windows app) which receives windows and user-defined messages. Right now, when user clicks the mouse and keep pressed the application locks. How can I resolve this? I have the restriction of one thread. ...

Most common reasons for unstable bugs in C++?

I am currently working on a large project, and I spend most of the time debugging. While debugging is a normal process, there are bugs, that are unstable, and these bugs are the greatest pain for the developer. The program does not work, well, sometimes... Sometimes it does, and there is nothing you can do about it. What can be done abo...

Data transmission through USB

I want to develop code to transmit data from system to PIC through USB. Can anybody give good link regarding data transmission through USB. because i am new to this. NOTE: Very simple is code is enough to me. Thanks in Advance ...

Catch a type error in C++

Hello all! How do i check if a result is of the right type(int, float, double, etc.) and then throw and catch an exception in case it's not? Thanks all, Vlad. ...

.Net - Can a Class Library (dll) written in .Net be used by an application written in C or C++?

Let's say I have written a Class Library (dll) in .Net and now I have developers using it in their .Net applications. However, the library itself could probably be useful also for developers writing natively (in C or C++). So my question is if my managed dll can be used in C or C++? If not, why? Maybe I must add some specific code to ...

iptables c++ control

I need to control inbound and outbound traffic to/from a linux box from within a C++ program. I could call iptables from within my program, but I'd much rather cut out the middle man and access the kernel API functions myself. I believe I need to use libnfnetlink, however, I have not been able to find any API documentation or example p...

How to modify an immutable object?

Sorry I couldn't think of a good title for this question... At application start I load objects from a database via a DB access library, lets call their class CDbObject. class CDbObject { //... virtual CState getState() const { return m_state; } protected: CState m_state; } At runtime, I receive messages which correspond t...

Static vs dynamic type checking in C++

Hello all, I want to know what are static and dynamic type checking and the differences between them. ...

Recommended books for Direct3D programming

What good books are there for learning 3D graphics programming (DirectX 9) ? I'm also interested in a book about pixel/vertex shaders. I've done some 3D graphics about two years ago using WPF, but I don't think this would help much. I'm pretty good at C++ and optimization (assembler, SSE, metaprogramming), so I don't think this would be ...

Why STL containers are preferred over MFC containers?

Previously I used to use MFC collection classes such CArray and CMap. After a while I switched to STL containers and have been using them for a while. Although I find STL much better, I am unable to pin point the exact reasons for it. Some of the reasoning such as : It requires MFC: does not hold because other parts of my program uses ...

How to get started with Drivers Programming under windows

Hello all I want to start learning drivers programming under windows . I never programed drivers , and i am looking for information how to get started . Any tutorials ,links ,book recommendations , and what development tool kit i should start with ? (WDF will be good one ?) I really want to program following clock link text Thanks ...