c++

How do I install GDI+ version 1.1 on Windows XP?

Has anyone done this successfully? As I understand, GDI+ 1.1 only ships with Vista. I'm trying to get my hands on the different Effects classes. I'm using C++ VS2008 (VC9) ...

Dynamic output filenames (C++)

I'm trying to create output files subscripted by a dynamic index ( d = {0,...,NUM_DEMES-1}). Currently, I'm only getting output files for the first value (d=0). #include <sstream> #include <string> void Simulation::updateSimulation( double t ) { ... ofstream abundanceStream; ofstream abHeaderStream; if ( step == 1 ) { for ...

Why does my program crash from an access violation after accepting user input?

i get this strange error while ruining my program with Visual C++ 2008 Express Edition: 'Ex2.exe': Loaded 'D:\studyMA\c++\visual studio\Ex2\Ex2\Debug\Ex2.exe', Symbols loaded. 'Ex2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll' 'Ex2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll' 'Ex2.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.Deb...

Templates, nested classes, and "expected constructor, destructor, or conversion before '&' token"

While working with some templates and writing myself a basic container class with iterators, I found myself needing to move the body of member functions from a template class into a separate file to conform to style guidelines. However, I've run into an interesting compile error: runtimearray.cpp:17: error: expected constructor, de...

Outputting unicode characters in windows terminal

Over the past week I've been working on a roguelike game in C++ along with a friend. Mostly too learn the language. I'm using: pdcurses Windows 7 Visual studio C++ To output wchar_t's wherever I want to in the console. I have succeeded in otuputting some unicode characters such as \u263B (☻), but others such as \u2638 (☸) will just ...

Is anybody working on a high level standard library for C++

STL/Boost cover all the low level stuff. But what about the higer level concepts? Windows: We have multiple windowing libs KDE(Qt) Gnome Motif(C but written in OO style) MS Windows etc But is anybody working on a unified standard for windowing? Somthing that wrapped all the above would be acceptable. (even if it only accessed the c...

Help me remove a Singleton: looking for an alternative

Background: I have some classes implementing a subject/observer design pattern that I've made thread-safe. A subject will notify it's observers by a simple method call observer->Notified( this ) if the observer was constructed in the same thread as the notification is being made. But if the observer was constructed in a different thread,...

Why ofstream would fail to open the file in C++? Reasons?

I am trying to open an output file which I am sure has a unique name but it fails once in a while. I could not find any information for what reasons the ofstream constructor would fail. EDIT: It starts failing at some point of time and after that it continuously fails until I stop the running program which write this file. EDIT: once i...

visual studio intellisense error

template <typename T> class Test { friend Test<T> & operator * (T lhs, const Test<T> & rhs) { Test<T> r(rhs); // return r *= lhs; } } 4 IntelliSense: identifier "T" is undefined why is T defined on line 3 but not line 4? i mean i guess its not a real error just an intellisense error... it works anyway but is t...

SDL_image/C++ OpenGL Program: IMG_Load() produces fuzzy images

I'm trying to load an image file and use it as a texture for a cube. I'm using SDL_image to do that. I used this image because I've found it in various file formats (tga, tif, jpg, png, bmp) The code : SDL_Surface * texture; //load an image to an SDL surface (i.e. a buffer) texture = IMG_Load("/Users/Foo/Code/xcode/test/lena.bmp")...

system call does not work same as command line

Ok I have two programs, and one calls another using executable from another. I am running it on Ubuntu terminal This is folder structure in place .../src/pgm1/pgm1 .../src/pgm0/pgm0 pgm1 and pgm0 are executables. This is how I call the other executable char cmd[1000]; string path = "/home/usr/src/"; // call pgm0 for e...

Is there a way to customize the tool tip of a custom object in the VS Debugger?

http://stackoverflow.com/questions/369192/is-there-a-way-to-customize-the-tool-tip-of-a-custom-object-in-the-vs-debugger/1725025#1725025 anyway to do same for unmanaged c++? thanks ...

Adding elements to a vector inside a c++ class not being stored

Edit: My debugger was lying to me. This is all irrelevant Howdy all, I had a peek at http://stackoverflow.com/questions/637438/adding-element-to-vector, but it's not helpful for my case. I'm trying to add an element (custom class LatLng) to another object (Cluster) from a third object (ClusterManager). When I pass my LatLng to Clust...

Memory Leak Analysis

There is a memory leak in my application. The memory consumption shoots up after a couple of days of running the application. I need to dump call stack information of each orphaned block address. How is it possible with WinDbg? I tried referring to document created by my colleague, but I'm confused about how to specify the symbol path ...

Failing to set COM+ ConstructorString on Win7 - CryptProtectData changes?

UPDATED I'm trying to programmatic-ally set a COM+ component's ConstructorString with a value for later initialization. The code in question works fine on WinXP, Win2k3, Vista and Win2k8. I'm failing on Win7 - Home Premium version. I've determined by trial and error that there seems to be a size limit on the constructor string - if t...

c++ error: operator []: 2 overloads have similar conversions

template <typename T> class v3 { private: T _a[3]; public: T & operator [] (unsigned int i) { return _a[i]; } const T & operator [] (unsigned int i) const { return _a[i]; } operator T * () { return _a; } operator const T * () const { return _a; } v3() { _a[0] = 0; // works _a[1] = 0; _a[2] = 0; ...

What are the possible ways to exchange data in binary format between windows and solaris?

Hi Everyone, Could someone please help and tell me if there is any possible way to pass a data structure (i.e. binary format) through internet sockets between a program running on Windows and other program running on Unix? Any idea or link to materials that deal with it would be very appreciated. Thanking you in advance for your help, ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how? ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr GetBitmap(System.IntPtr hwnd, int nBMPWIDTH, int nBMPHEIGHT); The H file section looks like: Cbitmap* GetBitmap(HWND hwnd,int nBMPWIDTH,int ...

typedef'ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, but when i ever attempt to create a new Foo::String from a wchar_t* i get an error, e.g.: namespace Bar { static const wchar_t* COMMON...