c++

c++ use custom cursor gdi

ok im trying to create cursor using gdi. i can't even find tutorial how to use customize cursor, i can find so many tutorials for c#. all i know that i use these two functions to set cursor,setcursor and loadcursor that is it thanks Rami ...

C++ current function name as string

Hello, Is there any way to get current function name in C++? I want to track some functions calls order. Is there something like __FILE__ or __LINE__? Thank you! ...

data repository based on std::map and boost::any: conversion errors

Hi, I am trying to implement a handy data repository or knowledge base for a little program of mine. I use a std::map of boost::any's to hold various pieces of information. For debugging and safety purposes, I have an extra safe accessor ''getVal()'' for the data. A snippet says more than a thousand words: EDIT: <<< Old snippet replac...

Preprocessor based exclusion of namespace qualified function calls.

I’m currently working on a reporting library as part of a large project. It contains a collection of logging and system message functions. I’m trying to utilize preprocessor macros to strip out a subset of the functions calls that are intended strictly for debugging, and the function definitions and implementations themselves, using cond...

Get hidden IvideoWindow Image

Hi, i need to get Image of hidden IvideoWindow ("ActiveMovie Window"), which shows webcam preview. As far as i can tell preview isn't overlay, it doesn't have overlay features, i can use printscreen on it, but i need window to stay hidden all the time, so that won't help. Also PrintWindow() api function returns me black screen. Program...

How to write a program in C++ such that it will delete itself after execution ?

How to write a program in C++ such that it will delete itself after execution ? ...

what exactly does runtime polymorphism mean ?

Hi, i'm slightly confused about this run time polymorphism. correct me if i am wrong, run time polymorphism means, function definitions will get resolved at run time. take this example.. class a { a(); ~a(); void baseclass(); } class b: class a { b(); ~b(); void derivedclass1(); } class c: class a { c(); ~c(); void derivedclass2(); ...

Passing an iterator to a function

Looking through the source code of a binary tree,I find the following function: //definition of BTR,in case you'd want to know template< class Type> struct BTR { // The item saved to that specifiec position into the tree Type value; // Points to the left leaf BTR<Type>* left; // Points to the right leaf ...

Rotated 2d rectangle intersection detection

I have 2 rectangles they are placed arbitrarily and I have rects all four corner point like struct Rect { NSPoint topLeft; NSPoint topRight; NSPoint bottomLeft; NSPoint bottomRight; } I want to check whether 2 rectangles intersects. I am looking a method similar to NSIntersectsRect . But NSIntersectsRectwon't respect the rota...

a data structure between multimap and vector

Possible Duplicate: A std::map that keep track of the order of insertion? I'm looking for a STL container that works like std::multimap but i can access the members in order of insertion like vector. for example: multimap<char,int> mymultimap; multimap<char,int>::iterator it; mymultimap.insert ( pair<char,int>('a',...

Serialize to XML using boost::serialization

Hi, This is a newbie question. I am trying to serialize some objects to XML, but the resulting XML contains a boost serialization signature, version information, class id, ...etc. that I do not need. Is there a way to get rid of them without post-processing the xml message? #include <fstream> #include <iostream> #include <boost/archive...

How to deal with noncopyable objects when inserting to containers in C++

I'm looking for the best-practice of dealing with non-copyable objects. I have a mutex class, that obviously should not be copyable. I added a private copy constructor to enforce that. That broke the code - some places simply needed to be fixed, but I have a generic problem where a class, using the mutex either as a data member, or by ...

Read raw data from jpeg file using jpeg_read_raw_data function.

Hi! Sorry for my bad english... So, I try to decompress 128x128 jpeg image that was created in Microsoft Paint. The image is all black. I use xawtv sources as example to create my own jpeg to yuv decompressor (http://xawtv.sourcearchive.com/documentation/3.95.dfsg.1/conv-mjpeg_8c-source.html). Decompressor works only with 4:2:0 level o...

Using enum in c++ and c# via c++ header

Hello, I've got a server written in C++ that sits at the end of a named pipe, um, serving things. The commands which can be sent to the server are defined in an enum which is located in a header file. enum { e_doThing1, e_doThing2 ... e_doLastThing }; The value of the desired enum is put into the first byte of message...

What belongs in an educational tool to demonstrate the unwarranted assumptions people make in C/C++?

I'd like to prepare a little educational tool for SO which should help beginners (and intermediate) programmers to recognize and challenge their unwarranted assumptions in C, C++ and their platforms. Examples: "integers wrap around" "everyone has ASCII" "I can store a function pointer in a void*" I figured that a small test program...

Vim C++ auto complete

How do I enable auto completion in Vim? I tried to do this one, but I'm not proficient with the vimrc file, etc., so it didn't work out. Can you give me step by step instructions on how to do this? Edit I tried installing OmniCppComplete. Followed the instructions, but when I try to use it I get the following error: Error detect...

How to make a COM in language other than C/C++?

I noticed that MIDL.exe only generates header file (*_h.h) and GUID file (*_i.c) for C/C++. Which facilitates creating COM in C/C++. What if I want to create COM in VB or some other language? IMO, I must define the interface in MIDL language first, and then compile it with MIDL.exe. So how could other languages utilize the output of MI...

How to check that template's parameter type is integral?

In the description of some std template function I saw something like: if the template parameter is of integral type, the behavior is such and such. otherwise, it is such and such. How can I do a similar test? Perhaps dynamic_cast? Since the function I write is for my personal use I can rely on myself to supply only correct para...

Can I use CORBA/RMI to make live audio streaming?

I need to communicate between server/client. I saw that CORBA is used for different languages to work like RMI, is it? In my application I will have to transfer objects between client/server, transfer binary files (which I saw that I can do with RMI) and also play live streaming from one client to another. I was thinking about CORBA beca...

C++ program not behaving as expected, double is converting up when it shouldn't be.

Hi guys, I was making a program that rounds up numbers with various decimal places, so as an example 2001.3666 would end up as 2001.37, I managed to make this work by adding 0.005 then times 100 and converted to a int and then divided again by 100. Everything worked fine, no issues there, was having some fun making some loops too and ...