c++

Does ASP.NET support C++?

When I go to New -> Web site, in the drop-down menu "Language" there are only 2 languages: Visual C# and Visual Basic. No Visual C++. Maybe, I'm using wrong version of Visual Studio? (mine is 9.0.21022) I tried to google this problem. I found a topic which tells that using C++ in ASP.NET is impossible. But it was posted in 2002 and I ho...

vector.resize function corrupting memory when size is too large.

what's happening is i'm reading encryption packets, and I encounter a corrupted packet that gives back a very large random number for the length. size_t nLengthRemaining = packet.nLength - (packet.m_pSource->GetPosition() - packet.nDataOffset); seckey.SecretValues.m_data.resize(nLengthRemaining); In this code m_data is a std::vector<...

Why does my C++ divide program not compile

Hi all , i'm totally new to c++ ... i tried to make a program that have a correct Divide function ... my code was : #include <iostream> using namespace std; double x,y,z,a ; double divide (x,y) { if (x >= y){ x=z ; z=y ; y=x ; return(x/y); else r...

Can anyone recommend a decent DSP/speech library in C++?

Google returns too much results, although SPUC caught my attention. Is there a standard recommended library like OpenCV for vision? The necessary features would be: Free Open Source filter design (Butterworth, Chebyshev, etc) FFT if possible, some speech processing features, like MFCC computation, although that's secondary, as I could ...

Why this warning from IBM XL C/C++ compiler?

Here's a minimum code example that illustrates the problem: #include <iostream> class Thing { // Non-copyable Thing(const Thing&); Thing& operator=(const Thing&); int n_; public: Thing(int n) : n_(n) {} int getValue() const { return n_;} }; void show(const Thing& t) { std::cout << t.getValue() << std::endl; } ...

How to use C++ classes with ctypes?

Hi there, I'm just getting started with ctypes and would like to use a C++ class that I have exported in a dll file from within python using ctypes. So lets say my C++ code looks something like this: class MyClass { public: int test(); ... I would know create a .dll file that contains this class and then load the .dll file in p...

C++ - "Member function not declared" in derived class

I have a problem in MSVC++ 2008 where VS2008 is throwing this compile error: error C2509: 'render' : member function not declared in 'PlayerSpriteKasua' Now, what's confusing me is that render() is defined, but in an inherited class. The class definition works like this: SpriteBase -Inherited By-> PlayerSpriteBase -Inherited By-> Pl...

Most natural blinking visualization?

What is the ideal method for blinking information on a display to draw attention to an error condition in some data in a natural fashion. Should the blink be all on / all off, or should there be an aspect of fast ramp up and down of brightness instead of instant on / off transitions? Should the blink be equally on and off, or should it...

Shifting elements in an array C++

Hello, I've developed a method called "rotate" to my stack object class. What I did was that if the stack contains elements: {0,2,3,4,5,6,7} I would needed to rotate the elements forwards and backwards. Where if i need to rotate forwards by 2 elements, then we would have, {3,4,5,6,7,0,2} in the array. And if I need to rotate backwards,...

does presence of mutex helps getting rid of volatile key word ?

Hi , I have a multi-R/W lock class that keeps the read, write and pending read , pending write counters. A mutex guards them from multiple threads. My question is Do we still need the counters to be declared as volatile so that the compiler won't screw it up while doing the optimization. Or does the compiler takes into account that t...

Using Perl with compiled C library?

I would like to try and use Perl, but need to communicate with another application I wrote. I have an interface library that I wrote in C++, and it contains the socket communications and interface protocol to set/get parameters in my application. I would like to use Perl with Apache to serve up web pages for configuring my application....

Why does an empty loop use so much processor time?

If I have an empty while loop in my code such as: while(true); It will drive the processor usage up to about 25%. However if I do the following: while(true) Sleep(1); It will only use about 1%. So why is that? Update: Thanks for all the great replies, but I guess I really should have asked this question, http://stackoverflow...

Storing a pointer to an object created in a method

Using C++: I currently have a method in which if an event occurs an object is created, and a pointer to that object is stored in a vector of pointers to objects of that class. However, since objects are destroyed once the local scope ends, does this mean that the pointer I stored to the object in the vector is now null or undefined? If ...

c++ send data to multiple UDP sockets

Hi all! I got a c++ non-blocking server socket, with all the clients stored in a std::map structure. I can call the send() method for each clientObject to send something to the connected client and that works pretty good already. But for sending a message to all (broadcast?) i wanna know: there is something better than do a for/loop w...

Transparent child control

Hello all, I'm writing a control that may have some of its parts transparent or semitransparent. Basically this control shows a png image (with alpha channel). The control's parent window has some graphics on it. Therefore, to make the png control render correctly it needs to get image of what the parent window would draw beneath it. Par...

Problem with Pointers in C++

char *str = NULL; str = Operation(argv[1]); cout << Cal(str); Operation function return a pointer, but I really don't know why str in Cal is null. in line 2, it still has content. What am I missing? ...

Boost::Xpressive compile puzzle under MinGW

Hello all :) Switching to GCC for the first time, and I'm getting a bit confused by what the compiler is telling me here. Essentially, it's behaving like boost::xpressive::wsregex is not defined (I believe). Here is the relevant code: #include "criterion.h" #include <string> #include <boost/xpressive/xpressive.hpp> //More lines of co...

How to make class not derivable at all. is there any way?

Hi any one let me know How to make class not derivable at all. is there any way? please let me know. regards Hara ...

FIFO queue (or stack) implemented on disk, not ram (preferably in C++)

Basically what I'm after is the equivalent of the Standard Template Library queue implemented in such a way as to use the disk for storage. The volume of data that will need to be in the queue is far greater than can be stored in the ram of most computers today. Ideally, I'm after a library to use. However, any recommendation on how to ...

function implementation in : file.h vs in file.cxx

Hi My question is very simple , I am working on a old legacy code where most of function are implemented in header file only. As per my knowledge, Compiler convert function implemented in header into inline functions. I wanted to know if i move these implementation into .cxx file , What will be benefits ? Thanks in Advance ~SS ...