I use std::stringstream extensively to construct strings and error messages in my application. The stringstreams are usually very short life automatic variables.
Will such usage cause heap reallocation for every variable?
Should I switch from temporary to class-member stringstream variable?
In latter case how can I reserve stringstrea...
I know it is a very simple question but i currently cant create a parent window...
My code:
LRESULT CALLBACK WndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
static HWND paste;
static HWND update_list;
/*HWND changeuser = CreateWindow(0, 0,
0,
0, 0, x, y,
...
I've got a library definition in CMake that builds a shared library out
of a small set of files, and I've got it compiling just fine on both linux and windows.
However, I've also got another library that links against the shared library and it works fine on linux, however, on windows I get a message along the lines or "error can't find ...
Basically I am looking for a graph library that would have fine-grained locking around graph operations, so that different threads touching different parts of the graph could alter it simultaneously, and competing modifications could be blocked.
I googled around a bit and can't find anything. Maybe this is too specific to my needs, but...
Probably a very newb C++ question. Say I have a class, vertex, with several properties and methods. I want to stuff a bunch of vertices into a queue, and have them ordered by a special property on the vertex class (doing a basic Dijkstra graph algo for school yes).
I'm having some problems penetrating the C++ syntax however. Here is my ...
I have a number of classes that I would like to explicitly disallow heap allocation for. It occurred to me this weekend that I could just declare operator new private (and unimplemented)... Sure enough, this results in compile errors when you attempt to new the class... My question is: Is there more to this? Am I missing something or is ...
I am running VS Team System 2008 on WinXP. I make a new Win32 C++ project (Empty project). I go to Build Configuration to add a configuration for x64.
The only options I have are:
- Pocket PC 2003 (ARMV4)
- Smartphone 2003 (ARMV4)
I have no option for x64 (or Itanium). However, if I make a C# project within the same solution, I can cre...
Platofrm - Linux, Arch - ARM
Programming lang - C/C++
Objective - map a regular (let say text) file to a pre-known location (physical address) in ram and pass that physical address to some other application. Size of the block which i map at a time is 128K.
The way I am trying to go about is-
User space process issues the ioctl call t...
Hello,
I need to keep a list(vector) of children for every class, and I've got a tricky problem:
class A
{
protected:
int a;
static vector<A*> children;
public:
A(int a): a(a) {;};
virtual void AddToChildren(A* obj);
virtual void ShowChildren();
virtual void Show();
};
class B: public A
{
protected:
int...
Is it possible to custom format currency strings using the ICU library similar to the way it lets you format time strings by providing a format string (e.g. "mm/dd/yyy").
So that for a given locale (say USD), if I wanted I could have all currency strings come back "xxx.00 $ USD".
...
I want to provide a global io_service that is driven by one global thread. Simple enough, I just have the thread body call io_service::run(). However, that doesn't work as run (run_one, poll, poll_one) return if there is no work to do. But, if the thread repeatedly calls run(), it will busy loop when there is nothing to do.
I'm looki...
On codeproject there is an example of extending the GDI+ Image class to support animated gif under C++
However, under .Net there is ImageAnimator. While looking at ImageAnimator I noticed that
they show support under 4 languages including C++. Does that mean ImageAnimator is actually
available under C++ as well?
http://msdn.microsoft...
Hi guys
I dont have much of a C++ background but have successfully hooked a window and converted its msgs into raised events that my application can consume, Ive started by inheriting from NativeWindow and overriding WndProc and have determined the msgs that im interested in, WM_VSCROLL and WM_HSCROLL for instance.
Firstly are there any...
I am having a issue with boost unit testing. Basically I create a fixture which is part of a suite to unit test a Resource cache. My main issue is between tests the Resource cache is becoming empty. So the first test that tests the cache passes then the second one will fail because the data the first test inserted into the cache is no...
What is new in the soon to be released libpng 1.4 series? The DLL is almost twice the size of 1.2.41
...
i'm reading about way to implemnt client-server in the most efficient manner, and i bumped into that link :
http://msdn.microsoft.com/en-us/library/ms740550%28VS.85%29.aspx
saying :
"Concurrent connections should not exceed two, except in special purpose applications. Exceeding two concurrent connections results in wasted resources. A ...
I'm working with IMAP and attempting to find a way to find the size of an IMAP message prior to actually uploading it to a server from a client (not a server-to-server transfer).
Once the message is actually on the server, finding its size is relatively easy - you can just use a BODY structure then use mail_fetchstructure, as in:
BODY ...
i'm looking for a book that talks about sofware decision like :
when should i use thread pool and shouldn't. and in the first case, explains how.
how should i acess my DB , how big my transactions should be
how to read XML, to use DOM or SAX, what library to choose, and best ways to parse
how to handle client-server app best efficient...
I like to initialize 2-dimensional arrays as vector<vector<int> >(x,y). x is passed to vector<vector<int> >'s constructor and y is passed to vector<int>'s constructor, x times. Although this seems to be forbidden by C++03, because the constructor is explicit, it always works, even on Comeau. I can also call vector::assign like this. But,...
n00b question. I am a C guy and I'm trying to understand some C++ code. I have the following function declaration:
int foo(const string &myname) {
cout << "called foo for: " << myname << endl;
return 0;
}
How does the function signature differ from the equivalent C:
int foo(const char *myname)
Is there a difference between usin...