c++

CPP:How to pause resume a running script in cmd line console using mouse ????

Hi All, I am in desperate need of help.... :). I am running a script from cmd line console. It does a sequence of operations. whats the best way to pause the script in between to check the results and resume it back using mouse????? or any key I would appreciate for your reply back, -Abishek ...

How can I override the close button to minimize instead for a specific application?

I would like to override the close button to minimize an application instead. Can I write such thing in C#? Or do I need to use C++? How do I write this kind of hook? Do I need a process running or would a driver/dll/service suffice? As far as I got researching I think I have to do something like this but I don't know how exactly: ...

Why could an enum type be used without defined

I am using VC2008 as my complier, and it is surprised to me that an enum could be used without defined: void func(enum EnumType type) { } Code above could be compiled and run without a problem, could anyone explain why it works? Update: I could define an empty enum in C++, as follow: enum EnumType {}; ...

Accessing an object's attributes correctly out of a vector and clearing it out

I'm unfamiliar with OO in C++. I've been pushing instances of the MyPoint class into vector <MyPoint> trianglePoints; like this: trianglePoints.push_back(MyPoint(x,y)); This is my definition of MyPoint: class MyPoint { public: float x; float y; MyPoint(float x, float y) //constructor { this->x=x; ...

define double constant as hexadecimal?

Hi, I would like to have the closest number below 1.0 as a floating point. By reading wikipedia's article on IEEE-745 I have managed to find out that the binary representation for 1.0 is 3FF0000000000000, so the closest double value is actually 0x3FEFFFFFFFFFFFFF. The only way I know of to initialize a double with this binary data is th...

Send data with boost::asio::socket_base.

Why does socket_base not have a send() method? Basically, I would like to use boost::asio's sockets like linux socket descriptors: whether the underlying socket is UDP or TCP it doesn't matter, you can call read(), write(), sendto(), etc... on them. Is there a more proper solution than just writing a wrapper class around asio's udp & tc...

Can I override an overload of an operator and return a different type?

class A{ public: virtual char &operator[](int); protected: .. }; class B:A{ public: A* &operator[](int); protected: } Can I change the return type when I overload an overload of an operator? thanks! //EDIT Okay, so now that we established that this wont work how can I build a work around? Lets say I have classe...

Why am I getting vector iterators incompatible?

I'm doing the following and getting that debug error: AguiWidgetBase* AguiWidgetContainer::recursiveGetWidgetUnderMouse( AguiWidgetBase* root, const AguiMouseEventArgs &mouse) { AguiWidgetBase* currentNode = root; bool foundsomething = true; while(foundsomething) { foundsomething = false; if(current...

Hosting a Server Written in C++

I want to host a server program written in C++. What are the best/easiest hosting options out there for native apps? I know for Rails there are EngineYard and Heroku. Is there something similar for native apps? I've looked at Amazon EC2, but that looks too heavy-duty to start off (I may be wrong). ...

Using C++0x TR1 random in a class, for low overhead

Hello, I'm using VC 2010 and trying to keep the overhead and duplicated code of certain functions low, by placing the random definitions in the constructor of each class instance, then calling as necessary from there. What I have now, simplified, is: #include <random> #include <Windows.h> mt19937 eng(GetTickCount()); class Cycles { ...

Differing between function argument names and class variable names

class line { public: line(int Width) : width(Width) { } private: int width; }; I could name Width something like wantedWidth, but I'm just wondering, is there a convention for this or a better way? I don't want to use Hungarian notation. ...

How do I find the number of objects that are alive in C++?

I want to find the objects of a class that are currently alive in C++. Please tell me a solution for this. Also, please correct if my logic is wrong! Declare a global variable. Increment it during the constructor invocation. Decrement during destructor invocation. Thanks in advance. Sanjeev ...

Passing date in c++

I need to pass DateTime value in C++. (Creating a plugin for AmiBroker) I have to pass it to AmiDate . I have date in long variable. (seconds from midnight January 1, 1980 ) The target structure is defined as below. // 8 byte (64 bit) date time stamp union AmiDate { DATE_TIME_INT Date; struct PackedDate PackDate; ...

Which IDE are you using under Unix/Linux for visual debugging?

I usually build the application in windows and test /port the application in UNIX using VI But what is I need to build the application from scratch in unix/linux in shell what option do I have to Visually debug (break point and such .. ) or syntax helpers? ( c/c++) ...

LNK2019 and LNK1120 with functions in an external file

I have taken out some functions from a source file into another since I want to use them also in other files. The current structure is as follows utils/extFuncs.h #ifndef _extFuncs_h #define _extFuncs_h inline int someFunction (float v); #endif utils/extFuncs.cpp #include "utils/extFuncs.h" inline int someFunction (float v) { re...

How to integrate Crypto++ into C++ Builder 2010 / [ILINK32 Error]

Hi, I was trying to compile the following (example) code via C++ Builder 2010: http://swarmapps.wordpress.com/2009/11/24/a-simplification-wrapper-for-the-crypto-library/ ( pastebin.com/f6bd13d59 / example.cpp ) ( pastebin.com/f2fc53f83 / BasicCryptoPPWrap.h ) There were no compiler errors but the linking failed: [ILINK32 Error] Erro...

Errors in simple template code

template <class T> struct ABC { typedef typename T* pT; }; int main(){} The above piece of code gives errors expected nested-name-specifier before 'T' expected ';' before '*' token What is wrong with the code sample? ...

Are these kinds of analysis for efficient use of stack frame memory slots possible ?

I know a compiler may detect life-time of different variables of a function and use the same stack frame slot for some different variables if it detects at beginning of life-time of each one of them life-time of previous variables has ended; but in case of local objects of classes in a function may it analyze life-time of members individ...

Detail learning of c++ design patterns

Hi Thanks for your valuable time. I want to learn c++ design patterns. I searched on web but I was not getting documents which gives me better details about design patterns. I was getting good details but those were in different URL's, I required all the information in one place only so that it will be better to know what all things a...

Applications list disappear from task manager when launch MFC applcation

Hello! I write MFC application, but when i launch it, in task manager on applications tab all applications list are disapear. if i do active some applications then she appears in applicion list, and when i close my MFC app all aplications are appears in app list on application tab. Why this happening? ...