c++

How to include boost::thread in your C++ project?

What do I need to do to include boost::thread in my project? I have copied the whole thread folder to my working path (I wish to be able to run this on several computers) and I get fatal error C1083: Cannot open include file: 'boost/thread/detail/platform.hpp': No such file or directory From the line #include "thread/thread...

c++ how to ? function_x ( new object1 )

Hi i want to do the next instead of MyClass object; function_x (object); i want to function_x ( new object ); so what will be the structure of the MyClass to be able to do that .. if i just compiled it , it gives me a compile time error answer function_x (MyClass() ) New Edit thanks for the quick answers.. i did ask the w...

Qt: How to send an event to the operating/window system?

I want to create an event in one Qt application that can be picked up by a seperate Qt application running at the same time. The normal sendevent function requires you to name the object which will receive it but I can't use that, I want it to be like a keyboard press event which filters through any open programs in the OS. Does anyone k...

Binding event to wxMenu instead of wxMenuItem

Im creating a dynamic MenuBar from xml file, and binding events to menu items using Connect(). Some menus does not have items inside, but needs to fire events. Is there a way to attach an event handler to a wxMenu using Connect()? *Im Using wxWidgets 2.8.8 & MS VC++ 6.0 ...

When are header-only libraries acceptable?

Personally, I quite like header-only libraries, but there are claims they cause code bloat due to over-inlining (as well as the other obvious problem of longer compile times). I was wondering, how much truth is there to these claims (the one about bloat)? Furthermore, are the costs 'justified'? (Obviously there are unavoidable cases su...

[C++][Linux]Generating UUIDs in Linux

I am stuck in a strange predicament. I need to generate UUIDs in my Linux program (which I distribute using RPMs). I do not want to add another dependency to my application by requiring the user to install libuuid (seems like libuuid isn't included in most Linux distros, like CentOS). Isn't there a standard Linux system call which gener...

Is "var" in C# analagous to "size_t" in C?

I have gotten used to using size_t in my C++ code by way of C due to a professor's insistence and I was curious if 'var' in C# is the same sort of thing? ...

Why have a pointer to a pointer (int **a)?

int **a = malloc2d(M, N) // dynamically allocates a 2D array What is the purpose of having int **a vice int *a. I understand that pointers are needed for dynamic allocation but why have a pointer to a pointer? For a 3-dimensional array would it be: int ***a ? ...

integrating new library in dev cpp

can anyone help me on how to integrate new library in dev cpp? i want to have a haru library to my compiler! ...

C++ Toolbar and Statusbar layout problem

I have created a toolbar that is located at the bottom of my application using the style flag CCS_BOTTOM. The problem is that I also have a status bar located at the bottom and when I use the style CCS_BOTTOM for my toolbar the two controls overlap each other. I am trying to get the toolbar to be located directly above the status bar. I...

template error is getting

// template Signal<float>; template Signal<bit_t>; template Signal<byte_t>; template Signal< std::complex<float> >; template Signal< int >; // ============= error at signal_T.cpp:437: error: expected unqualified-id before â;â token signal_T.cpp:438: error: expected unqualified-id before â;â token signal_T.cpp:439: error: expected u...

How to get the order of files/dirs in the Explorer?

I am programming in C++, Windows I wonder if I can get the order of files in a certain folder. the order of FileFind seems by alphabetic order. For example. I can drag folders/files in a folder. and if I open it again, the order will remain. I wish I can get this order. Many Thanks! Sorry for not stating my question clear enough. I tho...

Changing menu font

I have a handle to a Menu . I can change the text of each menu item by using API SetMenuItemInfo Now some of the menu's are in bold. I want to change their font to regular. What is the best way to do that? ...

what are the OOP features which are not in java but c++ has those features?

Respected Sir! As i have not learnt java yet but most people say that C++ has more OOP features than Java, I would like to know that what are the features that c++ has and java doesn't. Please explain. ...

Allocate more processor cycles to my program

I've been working on win32, c,c++ for a while. I code on visual studio. Most of the time I see system idle process uses more cpu utilization. Is there a way to allocate more processor cycles to my program to run it faster? I understand there might be limitations from i/o, in those cases this question doesn't make any sense. OR did i mis...

Unique Numerical ID for a Templated Class using Function Address

So, this question has been asked before, but I wanted a question with some of those key words in the title. The issue is simple: How can I have a templated class, such that for each instance of the template - but not each instance of the class - there is a unique, numerical identifier? That is, a way to differentiate: foo<int> f1; foo...

Active directory GUID

how can convert IADs ::get_GUID(BSTR * ) thar return bstr valur to GUID data type that have ( - ) in GUID ...

Quick way to fetch URL html contents with Qt?

I'm not interested in the QNetWork class and all it's callbacks, I want a static function or something where I can just: QString html = QHttpHelperThingy::fetch("http://blah.com"); Does such a thing exist? ...

effective C++ data structure to consider in this case

Greetings code-gurus! I am writing an algorithm that connects, for instance node_A of Region_A with node_D of Region_D. (node_A and node_D are just integers). There could be 100k+ such nodes. Assume that the line segment between A and D passes through a number of other regions, B, C, Z . There will be a maximum of 20 regions in betw...

C++ My first template ever

Ok, which is the best to avoid ambiguity here? template <class T> inline void swap(T &a, T &b) { T c; c = a; a = b; b = c; } /* blah blah blah (inside of a function:) */ for (itv = vals.begin(); itv != vals.end(); ++itv) { if (at < (*itv)) { swap(at, (*itv)); } if (at % (*itv) == 0) atadd = false; } /* blah blah blah */ Ca...