c++

Network Communication between a java socket (server) and a C++ socket (client)

I know this must be a pretty common problem, but I haven't been able to find a definitive answer on how to do it. First, assume we have a java server that accepts queries such as (I've just put the relevant lines, and I've taken out the exception handling for clarity): ServerSocket socket = new ServerSocket(port); while (true) ...

Access data passing through the networkcard using C++

Hi, Is there a way to control the data coming from the internet from specific address through the network card before it received by the kernel of the operating system using C++ or any language? In another word, Is there a way to access OSI Seven Layer Model using C++ to control the data passing through any layer of the seven layer or ...

How come I am getting weird results with istream::get(char*, streamsize n, char delim)?

I am reading in a file with a format similar to: TIME, x, y, z 00:00:00.000 , 1, 2 , 3 00:00:00.001 , 2 , 3 , 4 etc, and code similar to the following: std::ifstream& istream; char buffer[15]; double seconds, hours, mins; // initialised properly in real code // to read in first column istream.get(buffer, 14, ','); int scanned = std...

Eclipse & C/C++ - do I need to install a compiler separately?

I'm starting to learn C, and installed the eclipse plugin for C/C++ development (the CDT plugin). I'm testing the setup with a hello world program, but it looks like the eclipse C plugin (CDT) doesn't have a compiler built in. I thought eclipse plugins were usually self-sufficient? Do I need to install a compiler separately to complete m...

Managing destructors of managed (C#) and unmanaged (C++) objects

I have a managed object in a c# dll that maintains an anonymous integer handle to an unmanaged object in a c++ dll. Inside the c++ dll, the anonymous integer is used in an std::map to retrieve an unmanaged c++ object. Through this mechanism, I can maintain a loose association between a managed and unmanaged object using an anonymous inte...

Declaring a function static and later non-static: is it standard?

Hello, I noticed a very curious behavior that, if standard, I would be very happy to exploit (what I'd like to do with it is fairly complex to explain and irrelevant to the question). The behavior is: static void name(); void name() { /* This function is now static, even if in the declaration * there is no static keyword. Test...

C/C++ IDEs that come with/without the compiler

I'm getting started with C and usually use eclipse for other development. But it turned out that the eclipse CDT plugin doesn't come with the compiler and therefore installing a compiler separately is required (since I'm on windows vista). What C/C++ IDEs do you use that you know already come with the compiler. I've been told Microsoft ...

Installing msvcr90.dll easy way! (without C++ Redistributable Package)

My program is a converted python file to exe file. The problem with this exe file is that it does not run without python installed and it only needs mscvr90.dll! I don't want to install C++ Redistributable Package just for this dll file! That big fat package! If I copy this msvcr90.dll to my application folder it just won't work! The f...

Capture camera stream to screen

Hi, I'm googling since two days and I cannot find any solution for this: I'm using Windows Mobile and I need to capture (with directdraw) the input from a camera device and output it directly on screen. You could think of it as a copy of the camera application that's built in to the Windwos Mobile OS. What I've been trying is to use ...

open failed: No such file or directory

I have built a standalone executable which references my .so object. both are in the same directory. when I try to run executable it gives me the following error: ld.so.1: myExec: fatal: libMine.so: open failed: No such file or directory what am I doing wrong? ...

how to get TIMESTAMP column from Oracle DB into C++ (MFC or WIN32)?

Hi, I need to get value of column (TIMESTAMP) from oracle DB into C++. Then which dataype i should map to access database field (In MFC or WinAPI any) or what should in do to do this in proper manner. Thanks, Anuj Seharavat edit Additional info: I need to fetch data from database. I am using CRecordset class and function RFX_Date i...

C++ Array Constructor

hi together, I was just wondering, whether an array member of a class could be created immediately upon class construction: class C { public: C(int a) : i(a) {} private: int i; }; class D { public: D() : a(5, 8) {} D(int m, int n) : a(m,n) {} private: C a[2]; }; As far as...

Is there any method for multiplying matrices having O(n) complexity?

I want to multiply two matrices but the triple loop has O(n3) complexity. Is there any algorithm in dynamic programming to multiply two matrices with O(n) complexity? ...

What is meant by delegates in C++?

What is mean by delegates in c++, does sort function in c/c++ which takes a compare function/functor as last parameter is a form of delegate? ...

linux distro for Embedded development??

Hi all, I have an embedded board . Can someone suggest an Ideal Linux distro for such a configuration, keeping in mind that it also needs to capture images in realtime. I plan to use Qt_Embedded for application development on such a system. Thanks ...

How do you save data in MFC ?

I still remember in Delphi, developer can just make the UI(textbox, listbox...) directly connect to database, and then when user click a button, just call the post action, then the data will be saved automatically. What I want to know is that is there any similar mechanism in MFC? Or I can use GetDlgItem(...).Text and then use this v...

Notification when Windows Dialog is opened

I want to do some processing when a particular dialog is opened but I am not able to find any way to get notification when that dialog is opened. Is there any way to get notification in application for opening of a particular windows dialog? The only available information about the dialog is its title and its unique. ...

How to set toolbar button height?

When adding buttons to a toolbar (using the old Windows API) I can't seem to find a way to change the height of a button. I need to be able to increase the button's height because I'm using large icons. I'm currently painting everything myself using custom draw because I wanted to be able to have icons with different widths which is not...

Get the name of application in focus (on Mac)

Hello All, I have a requirement where, I need to have the name of the running application in focus. I am using C++/Qt/Carbon. Any help is highly appreciated. Thanks, Rahul ...

GetOpenFileName() kills my background open streams :(

Its a little strange. Ok so I am working with OGRE game engine which has a "SceneManager" class which keeps some files streams open in background. If i use those streams just BEFORE using GetOpenFileName() those streams work fine, but if I try to use those streams AFTER GetOpenFileName() those strams are found to be closed. Can someone t...