c++

Will using CreateEvent to create/open an even that already exists reset the signal?

If I use CreateEvent to open an event: responseWaitEvent = CreateEvent(NULL, // no security TRUE, // manual-reset event FALSE, // not signaled (LPTSTR)eventName); // event name And this event already exists and has been signaled. Will this call reset the signal (because of setting initial state to FALSE). Or ...

custom C++ visualisers for a standard Visual Studio 2005 STL anyone?

Does anyone have a custom visualisers (autoexp.dat) for a standard (not STLPort one) version of a STL for VS2005 would like to share. The ones which are being shipped with a VS2005 quite useless - does not show a number of stored item, require a lot of expandings to get the container values, list goes on. If you have a custom version o...

Bitfields vs. Polymorphism for game map object attributes

This optimzation question has been bugging me for the last day. In my program (a simple roguelike game), I use bitwise flags to store the attributes of map objects, such as if they are solid, or if they are rendered. However, I could accomplish the thing using polymorphism to return the appropriate value. My question is, is either way...

Application GUI development platform

Coming from C++ & MFC background, is there any better (maintainability/customization) platform in developing application GUI ? We are developing industrial applications (machine vision), where : -Performance-critical (mostly image processing in CPU atm, but GPU is up next) -Low level hardware interfacing (inhouse PCI device, frame gr...

Implementing atomic<T>::store

I'm attempting to implement the atomic library from the C++0x draft. Specifically, I'm implementing §29.6/8, the store method: template <typename T> void atomic<T>::store(T pDesired, memory_order pOrder = memory_order_seq_cst); The requirement states: The order argument shall not be memory_order_consume, memory_order_acquire, nor...

How do I delete a node from linked list? c++

How can I delete a node (between two nodes) from a single linked list without passing any parameters to the class function? For example, I have a list of 6 nodes with one head node and i want to delete 2 of them (without prior knowledge of their address or position) from a class function, how would i do that? void WordList::deleteNod...

asio::io_service hangs on destruction

Hello, i have timer implemented with boost (144 -> newest lib). This timer is started within a boos thread. The timer also starts a thread in which an io_service hosts deadline timer until thread is terminated. so a continuous timer. The boost thread which needs the timer is create from within DLL. The DLL ExitInstance function is call...

Why does this C++ program print irrelevant characters?

Hey i am new to programming in C++, and i get the hang of it but i got stuck on this one simple problem i am suppose to create a shift cipher using the letters A-Z and shifting them 3 places, i get everything but when i do my output i get extra letters that are unneeded like "|[|" i know i have to put a terminator and i did but doesn't s...

C++ or C++0x - Which is a better standard?

So I've been trying to do some research and would like the opinions of other developers on this topic. I am an experienced C++ programmer and have been using the current C++ standard for some time. I have been reading articles that "C++0x will undoubtedly become the new standard." How far off are we does everyone think from making the sw...

Difference in FMOD between Sound.readData and Sound.lock?

I'm trying to sort the difference between Sound.readData and Sound.lock in the FMOD library (I'm programming in C#/C++ but I'll take the answer in any language!). The end goal is to create a view of the waveform, which I understand cannot be done (easily) with Channel.getWaveData. I have been able to get both the Sound.readData and S...

text file input issues in C++

I am having to read a text file; however, one certain text file is giving me issues. Not only is the text file huge (an entire ebook), but there are also several accented letters. I am reading in the words one letter at a time stopping on appropriate punctuation or spaces. I do this by testing appropriate ASCII for letters and punctua...

c++ directx gaming: images vs vertices

In video games, do they use images or do they draw everything using vertices? ...

C++ Bubble sorting a Doubly Linked List

I know bubble sort is probably not the fastest way to do this but its acceptable. i'm just having trouble with adjusting the algorithm to double link lists from arrays. My double linked lists have a type int and a type string to hold a number and a word. My list was sorted with an insertion sort that I wrote to sort alphabetically, now ...

How to have macros expanded by doxygen, but not documented as a define?

Say I have: #define MY_MACRO(FOO) void FOO(); MY_MACRO(hi); MY_MACRO(hey); MY_MACRO(hello); #undef MY_MACRO I want the macros to be expanded by doxygen, which I am able to do by configuring it the right way: ENABLE_PREPROCESSING = YES MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES EXPAND_AS_DEFINED = MY_MACRO Th...

GDB step over function(next) doesn't seem to work

I'm trying to debug a program I wrote in C++. Here is the code: void a() { } void b() { a(); } int main() { b(); return 0; } I compiled it using: g++ -g3 -O0 -o cards.exe cards.cpp. Here is the output of my gdb session: (gdb) b main Breakpoint 1 at 0x401421: file cards.cpp, line 10. (gdb) r Starting program: C:\workspace\Cards\src...

Why does compilation of this simple C++ program using 'cpp' fail?

Hello everyone, I am a beginner in C++ I am average at C. I have written the following code in C++ (file.cpp) #include <iostream> int main(){ std::cout<<"My name is ANTHONY"; } Then I tried to compile the above code using cpp file.cpp but got some errors. I don't know whats wrong When I tried to compile my C program (changed <...

Require return type of function template to be specialization of a template

I've poked around on stackoverflow for a while, but either I don't understand templates enough to find a solution, or it simply hasn't been answered before. In this example: template <typename T> T f(); Is it possible to make the function require type T to be a specialization of the std::basic_string template? I could have the templ...

C++ Linux TCP sockets fd

how do i change the socket id/FD after i use accept() ? lets say i bind() on sockfd 3 and the accepted client is on sockfd 4, how do i change/move that sockfd to 1000? OS : Ubuntu ...

Templates :Name resolution -->IS this statement is true while inheritance?

This is the statement from ISO C++ Standard 14.6/6: Within the definition of a class template or within the definition of a member of a class template, the keyword typename is not required when referring to the unqualified name of a previously declared member of the class template that declares a type. The keyword typename shall alwa...

Virtual base class constructors are invoked first followed by an orderly invocation of constrctors of other classes.

Can somebody explain why it is so ? ...