c++

condition execution using if or logic

when using objects I sometimes test for their existence e.g if(object) object->Use(); could i just use (object && object->Use()); and what differences are there, if any? ...

Killing the focus isn't killing the focus

Here is what I'm doing. I'v created a combobox but I'm not using it for that. When I click it, it calls trackpopup and brings up a context menu. However after I'v clicked the context menu, I'd like it to close the combobox in the same way it would if you clicked anywhere (killing the focus) or selected an item from the combobox. Here's ...

How C++ call class method() in context of object1 by calling object.method().

how C++ mech works when we call object.method(), how can it call method of the class in context of the object without mixing with any other object. and that object become "this" object in that method. how this mapping is managed. I understand when it comes to virtual function call, you have vptr pointer and v-table to locate the functi...

Compiling mp4v2 on Mac OS X

Hi Anybody can help me with compiling mp4v2 on Mac OS X? I've tried configuring and compiling as per the instructions but I got a lot of errors originating from the C++ headers. The configure command was ./configure --enable-ub followed by plain make at the Terminal. From the looks of the error messages, it seems that a number of hea...

Should I do my object oriented design class with Java or C++?

I learned the C programming language and did my data structures class with C. What I am thinking is to learn Java. I know how the low level stuff works and people suggested that C++ is not a good language to do object oriented design. What do you think? Should I skip C++ and learn object oriented design using Java or should I first learn...

How can I programmatically launch visual studio and send it to a specific file / line?

I have a nice tidy way of capturing unhandled exceptions which I display to my users and (optionally) get emailed to myself. They generally look something like this: Uncaught exception encountered in MyApp (Version 1.1.0)! Exception: Object reference not set to an instance of an object. Exception type: System.NullReferenceExcepti...

Crystal Reports on Windows 7 64bit with C++

Hi, i have a qt application that opens a Crystal Reports window. this applications works in WindowsXP 32bit but does not work on Windows7 64bit. I see a blank/emty white screen. i even cant see the buttons of crystal reports. i make another project in C# that opens a Crystal Reports window on Windows7 64bit and it works fine. do you...

Is there any advantage for Java over C#

Hi all, This question may sound silly.. but my intention is to understand advantages of Java over all other programming languages ?? I guess c# is more or less similar to java.. also c# is derived from c++ which inturn is derived from C.. So learning which language is more easier or helpful in understanding concepts & developing ...

snmp agent libraries for C/C++?

I have to implement a performance statistics MIB for a linux based device and I am looking for a good agent development library. I came across net-snmp and agent++ libraries. I am looking for easier to understand and robust library. Which is the best library if usability and robustness is main criteria? ...

Doxygen: multiple \mainpage blocks in a C++ project

I wasn't able to determine what the behavior of doxygen is regarding the \mainpage section, in two cases: If you specify no \mainpage section, does it use any other page instead and if so how is this picked? What if two files both specify a \mainpage section? ...

Recursively Insert Element Into A Binary Tree

So I finished my List exercise and went ahead with Binary Trees. My code thus far: Tree.h #include "Node.h" class Tree { private: int mCount; Node *root; public: Tree(); ~Tree(); void insert(int, Node *); }; Tree.cpp void Tree::insert(int data, Node *node) { if( root == 0 ) { Node *temp = new ...

In C and C++, can I use macros definitions containing space?

Hello, I am wondering if macro definitions can contain space. Let's take for example this code: #define MACRO_PARAM int param2 int function(int param1, MACRO_PARAM) { return param1+param2; } This works ok with Visual Studio 8 and gcc 3.4.5 (mingw). For me this is good enough for the moment but is this standard? or can I rely on ...

Do I have to set pointer to nullptr in destructor?

Possible Duplicate: Is it worth setting pointers to NULL in a destructor? Do I have to do something like so: ~MyClass() { delete[] my_data_; my_data_ = nullptr;//DO I HAVE TO WRITE THIS LINE? } Thank you. ...

C++ program parsing arguments

I want to make a program to be called from the command line like this: myprogram.exe -F/-T FILE/TEXT -W FILE.WAV -P FILE.PHO -A They are 3 parts: myprogram.exe -F OR -T and the File or text -W FILE -P FILE and -A (At least one, up to 3, in any order (or not, if it's complicated)) So it can be: myprogram.exe -T "Text Text, test te...

How to set input/output to gpio pins?

Hello, Am using omapl138 with win ce as the os.I want to check the gpio pins whether the input corresponding to the pin on the board is correct or not. i ve no idea how to test the GPIO pins. can anybody help me to check the gpio pins. Regards Vinoth. ...

Polymorphic Enum in C++

I have these Enum declarations: enum MessageType{ REQ_LOGIN, REQ_GET_FIELD, RES_LOGIN, RES_GET_FIELD } enum Request{ REQ_LOGIN, REQ_GET_FIELD }; enum Respond{ RES_LOGIN, RES_GET_FIELD }; Obviously I'm repeating elements in Enum's. Is there any way to prevent this? EDIT: I'm using "MessageTy...

strange double pointer null check

Is this a valid null check on a DOUBLE pointer parameter passed in a function if (!pdblValue) return E_POINTER; ...

Modify,block HTTP connection

Hi, i would like to write proxy in vc++, which blocks some http requests. Can you please advice me, how to intercept and examinate these requests. What do i need to do this? ...

Why Free crashes when called twice

Hi, Free() crashes when it is called twice... not understood why. there is bookkeeping of every malloc() along with the size. when first free is called then it identifies that this was allocated with what size that's why we need not to pass size along with free call. since it knows every thing why does not it check second time when it...

Get/set combo-box text in Win32 (not MFC)

I can use GetDlgItemText to get the text from a control, but I want to clear the selection and SetDlgItemText(IDC_CTRL,_T("")); doesn't work. What is the right approach here? ...