c++

c++ meaning of the use of const in the signature

Please help me understand the following signature: err_type funcName(const Type& buffer) const; so for the first const, does that mean the contents of Type cannot change or that the reference cannot change? secondly, what does the second const mean? I don't really even have a hint. Thanks in advance, jbu ...

Access iPhone from Windows

I've seen a couple programs running in Windows that could access the iPhone and iTouch with access to the photo library and music. What APIs are used for this kind of development? ...

Boost shared_memory_object problem with types different from char...

I have a problem with boost shared_memory_object and mapped_region. I want to write a set of objects (structures) in the memory object. If the structure contains just a char, everything is ok; if I just add an int to the structure, then if I put too many objects (let's say 70, so much less than the limit of the block) I get a segmentatio...

Deploy Qt+Boost application on a Mac and Windows.

How to deploy Qt+Boost Application on Mac OS X or Windows platform. I use Qt Creator + Qt 4.6 + MacOS 10.6 How to compile my application into release to run it on another computer w/o installed Qt libraries? ...

boost::bind with null function pointers

If the function pointer embedded in a boost::bind return object is NULL/nullptr/0, I need to take action other than calling it. How can I determine if the object contains a null function pointer? Addenda I don't believe I can use and compare boost::functions as the boost::bind return object is used with varying call signatures in a te...

Static class member declaration error

I am trying to find dynamically and statically instantiated objects number. I am getting errors that variable myheap is not declared. #include<iostream.h> #include<stdlib.h> class A { public: static int x; //To count number of total objects. incremented in constructor static int myheap; //To count number of heap objects. Increm...

Accessing Public Class Function in Private Class Giving Error.

class test { private: class privateStruct { public: int m; privateStruct(int p){m=p;} }; }; void ff() { test::privateStruct ps(4); throw ps; //Does not work.. } void main() { try { ff(); } catch(...) { } } But the Following Code Works Why class test { private: ...

Windows Peer to Peer Global_ Group without third party ipv6 tunnel

I have been trying to develop a peer to peer application that uses Micosoft's Peer to Peer Group library. Basing my work on the Creating a Group Chat Application acrticle on msdn. This works fine for local groups and will also work for global groups if I have a thrid party tunnel adapter installed such as the gogo6 client. However fro...

Problem in calling a virtual function across Symbian DLLs.

My IM application setup is like below: User Interface module (exe) Plugin module ( A polymorphic DLL that provides an abstract interface for different protocols to the UI module ) Several Protocol DLLs ( Shared library DLLs that implement the respective protocols, like Jabber, ICQ etc ) Now, I was asked to implement contact list cach...

C++ Equivalent java.util.concurrent.ArrayBlockingQueue

May I know is there any C++ equivalent class, to Java java.util.concurrent.ArrayBlockingQueue http://download.java.net/jdk7/docs/api/java/util/concurrent/ArrayBlockingQueue.html ...

C++ Template specialisation issue

I have code that boils down to this: //Just a templated array class .. implementation doesn't matter template<int N> struct Array {}; //A simple Traits like class template<typename T> struct MyTraits {} //Specialization of the traits class template<int N> struct Foo< Array<N> > { static void monkey() {}; } int main() { Foo< Array...

problem in passing parameters in c++ (pointers confused me)

hi , I've write a procedure which will store some data inside a structure and the I will pass the structure to other procedure like below slotUpdate(Datas); whereas I've defined the structure like : someNameSpace::stuData Datas; after passing the structure to slotUpdate again I'll pass it to another procedure but this time as a pa...

changes not reflected in the variable values passed between C# code and C++ code

Hi, I have an application which uses C# front end and a C++ DLL as the backend. I am trying to pass an array from C# code to the C++ code in the DLL which changes the values in that array. But when I try to retrieve the values of the array from C# code after the call is made to the C++ DLL function, the changes are not being reflected. I...

Can i use boost::threadpool as a 'thread-safe queue'?

What I need is actually a thread-safe queue structure, where multiple clients keep dumping data into the queue and one working thread keeps processing and popping the queue is there any well-established solution existing in STL or Boost? I now think about using Boost::threadpool to do this. Simply set the number of parallel threads to ...

Looking for C++ FSM classes for embedded project

I'd like some (freely reusable) C++ classes to represent states, events and Finite State Machines (FSM). Maybe each even has a unique ID and string name which can be used when debugging. Maybe each state has the same plus an OnEnter() and OnExit() function, etc and maybe each FSM has a collection of states, each of which accepts various...

resolving reference in FLTK (Fl_Widget)

hello, thanks for looking I've completed the FLTK chapter in Bjarne's new book but I'm trying to run a simple FLTK code and I'm getting this reference error error LNK2019: unresolved external symbol "public: __thiscall Fl_Widget::Fl_Widget(int,int,int,int,char const *)" (??0Fl_Widget@@QAE@HHHHPBD@Z) referenced in function "public: __thi...

IPC between .NET and C++ applications

Are there any libraries for inter-process communication (IPC) between a .NET application and a native C++ application? ...

cin.get() and omitting newline char

Hi there. I have a small, simple program with menu and submenus. User choose from 1-9 and hits enter. I want the code to read ONLY numbers 1-9 removing "\n" from stdin. I've tried sth like this: #include <cstdio> #include <iostream> using std::cin; using std::cout; using std::endl; class cProgram { private: char W; public: ...

Get stack backtrace of a running process

I'm trying to get the stack backtrace of a running process (PID and binary path are known) from another program. The program in question is written in C++ and compiled with g++ with gdb debugging symbols. I'm looking for a C or C++ library that works across Linux, HP-UX and Solaris that produces an output similar to the output of callin...

Reading files multi-data-type (c++)

Dear all, I want to read from one file that has several kinds of data-types. I utilize ifstream (C++ language) but it can't read strings. In fact, I have written a code that has too many options and input parameters. Now, I want to read these parameters and (bool) options from an input file, then I can run my program by edition of inp...