c++

How to connect a C++ COM To a WCF Service

Hello all, I'm looking to a way to connect a COM+ legacy application to a WCF Service, i have been researching this since a couple of days and i haven been lucky to find any useful information, can anyone point me into the right direction on this? I Need the old COM+ component to make calls to a new C# WCF Service so I Need some kind of...

C++ project reference in a C# project in visual studio 2008

Is is possible to reference a C++ project in a C# Project? I've tried adding a reference in the c# project to that C++ one but I get an error saying "A reference to could not be added" ...

C++ inheritance public and private?

Is it possible to inherit both or all parts of a class (other than private) in C++? class A { } clas B : ...? { } ...

How can I do this for cubic beziers?

Right now i'm creating polygons with bezier handles. It's working well, except right now I always do something like this: for(float i = 0; i < 1; i += 0.04) { interpolate A, a.handle to B.handle, B at time i } The problem is no matter how short the distance or long the distance between point A and B, it always produces the same amo...

Determining the unique rows of a 2D array (vector<vector<T> >)

Howdy folks, I am using a datatype of std::vector<std::vector<T> > to store a 2D matrix/array. I would like to determine the unique rows of this matrix. I am looking for any advice or pointers on how to go about doing this operation. I have tried two methods. Method 1: slightly convoluted. I keep an index for each row with 0/1 ...

Palm OS 5.4 (Garnet) IR programming (Use CIR on IrDa port)

I would like to create an open source alternative to Palm OS programs like Noviiremote and Omniremote. I need to access the IR port of my Tungsten E2 and use it to transmit remote control type signals (I assume NEC and/or RC-5). Are there any libraries out there I could use? If not, how do I go about transmitting raw codes via the IrDa...

C++ default argument value

Where does the compiler store default argument values in C++? global heap, stack or data segment? Thanks Jack ...

How can I "double overload" an operator?

If I have a database-like class, and I want to do something like this: object[1] == otherObject; How do I "double overload" operator[] and operator==? ...

Where can I find the implementation for std::string

I am looking for the code for the c++ string class. What header is it implemented in? ...

boost::asio fails to close TCP connection cleanly.

I am trying to implement a simple HTTP server. I am able to send the HTTP response to clients but the issue is that on Firefox I get "Connection Reset" error. IE too fails, while Chrome works perfectly and displays the HTML I sent in the response. If I telnet to my server then I get "Connection Lost" message, just after the response. So...

Cross platform recursive file list using C++?

What is the most efficient way to recursively list files in a specific directory and its subdirectories? Should I use the standard library, or use some third party? I want this because I use v8 as a JavaScript engine, and I want to execute all scripts in some directory (and its subdirectories). If there's any built-in way to do that in...

How vector allocate memory

Hii I know that vector allocated contiguous fixed memory when it needs to push_back some items.And if its not able to fit into it it will alllocate new memory and copy old values into it and delete the old memory. If that is the case how the following code works #include<iostream> #include<vector> using namespace std; class ...

Secure data transfer over http with custom server

hi I am pretty new to security aspect of application. I have a C++ window service (server) that listens to a particular port for http requests. The http requests can be made via ajax or C# client. Due to some scope change now we have to secure this communication between the clients and custom server written in C++. Therefore i am looki...

Setting a watch point for a variable with Qt Creator

How to say to Qt Creator to stop debuging if an object has been changed and show the line where it is changed? ...

Macro definition in cross-platform

When development various platforms(Android,iPhone,Mac,Windows and so on), it is necessary diverged processing(#ifdef/#endif) by depends on an platform definition. But, I don't know original definition in Mac/iPhone/Android.  Windows : WIN32 (Visual C++)  Mac : __MAC_NA(?) (XCode)  iPhone/iPad/iPod : __IPHONE_NA(?) (XCode)  Android :...

How to use F10 as a shortcut in an MFC application using a Ribbon

Hello, I developed an MFC application using VS2008 and the MFC featurepack. This application UI is using a ribbon. I now need to have F10 as a proper shortcut for one of the critical feature of my application but I seem to be unable to set the accelerator correctly as it always use the default ribbon accelerator over mine. Any idea ho...

What do I call a "normal" variable?

int* p; int& r; int i; double* p2; double& r2; double d; p and p2 are pointers, r and r2 are references, but what are i and d? (No, I am not looking for the answer "an int and a double") I am looking for a name to use for "normal" variables, setting them apart from pointers and references. I don't believe that such a name doesn't exis...

C++ Coding Logic - Various Ideas

I want to write a method to determine if a given string is a palindrome. E.g. "Madam I'm Adam", or "A man, a plan, a canal, Panama". The prototype for the function is: bool is_palindrome(char const * str) I have a simple logic to check for equality by moving forward & backward from extreme ends of the string. But, i would like to ...

Default project in Visual C++ 2008

In Visual C++ 2008 ( Professional Edition )it is impossible to create default project for a .cpp file. Sometimes it is inconvenient. Is there an edition of Visual C++ 2008 which allows it? ...

C++ - Single Linked List - Ideas

I want to write a method to remove consecutive items with duplicate data values from a singly linked list. The method should return the number of items removed. The method should clean up memory as required, and should assume that memory was allocated using new. For example, passing in the list ->a->b->c->c->a->b->b->b->a->null should ...