c++

Getting return value of a function called with assembly

I am using Microsoft Visual C++ 2010. If I have a function like this: const char* blah(void); and I want to call it like this: __asm { call blah; ... } How do I get the return value of the function in the assembly? ...

How to make tab text orientation of a notebook vertical (in gtkmm)

Hi, I want my notebook tab labels to be rotated by 90°. I tried the set_angle() function of Gtk::Label but it doesn't work: #include <gtkmm.h> int main(int argc, char *argv[]) { Gtk::Main kit(argc, argv); Gtk::Window mainwindow; Gtk::Notebook sidebar; Gtk::Label tab; mainwindow.add(sidebar); sidebar.set_tab...

Use Armadillo for VS 2008 project

Hi everybody, i´m so confused. i wanted to use the armadillo "C++ linear algebra library". i downloaded it from there website and tried their example and it works. i understood the stuff with lapack and blas. So now i wanted to use the armadillo lib in my project. i included armadillo and linked the precompiled libraries lapack and bla...

Which is faster, GDI+ or libpng?

I have an HBITMAP and i would like to convert it to png format(in memory i have malloc'd)as fast as possible, so my question is should i go with GDI+ or libpng? I've tried using GDI+, but it doesn't seem as fast as i would like it to be. I've also tried FreeImage and it was way too slow. P.S. - I'm using C++ Thanks for reading ...

Should the NVI idiom be used for simple interface classes?

Which should I use? struct IFilterTreeNode { virtual unsigned int GetEasiestProveRank() const = 0; virtual unsigned int GetEasiestDisproveRank() const = 0; virtual unsigned int GetEasiestProveNumber() const = 0; virtual unsigned int GetEasiestDisproveNumber() const = 0; virtual std::vector<IFilterTreeNode *> GetChild...

How do I create a file with a user-supplied name in C++?

I want the user to be able to type some text and then the computer creates a file called what ever the text was. In C++. ...

boost library in microsoft c++

i am using microsoft visual c++ 2010 can i use boost library or does it requires different compiler? ...

How to call function with address having stack object as argument with heap based data

Hello, I have a complex problem to be solve, as I am stuck and found no way at all to solve this. Here's a code struct MyStruct { int x; float y; char c; }; void foo(MyStruct a_myStruct); int _tmain(int argc, _TCHAR* argv[]) { void *pMyStruct = malloc(sizeof(MyStruct)); int* pInt = (int*)pMyStruct; *pI...

Bug in best-fit ellipse code

I would appreciate an extra set of eyes on this code. It's supposed to find a best-fit ellipse for a set of data points. The problem is that the length of major & minor axis (aDist and bDist) are coming out larger than they should. Inputs: points - a set of (x,y) coordinates for the data points; x and y are non-negative avgX, avgY...

Accessing ivars of an objective-c class within c++ function

I have an objective-c class, which has a string ivar which I need to change when a callback function is called. The trouble is that the callback is in c++, and I therefore cannot access the ivars of the objective-c class in that c++ function. The callback must be in c++ that, cannot change. I realize that there are other ways this could ...

Iterator member behavior

I was expecting the second assert in the following to pass. I'm asking for your help. Edit: It didn't work when I had poss everywhere instead of poss_a in some places. #include <vector> #include <cassert> class Sampler { public: std::vector<int*> poss; std::vector<int*>::const_iterator poss_it; Sampler(std::vector<int*> poss_a) : ...

Why is a QProgressDialog doesn't get updated after executing a QProcess?

I am using a QProgressDialog to show the status of a long running operation, which includes a step of running an external executable. I run the external executable using the QProcess::execute() method. QprogressDialog works fine updating the label text till it reaches the QProcess::execute() method, after which it doesn't update the stat...

Performance of shift operations in Java vs. C++

What is the performance of Shift Operation in Java compared to C++ ...

Troubles with errno.h

I'm coding a simple SDL program with VC10. The problem that I am having is at compiling the program: Error 1 error C1083: Cannot open include file: 'errno.h': No such file or directory c:\program files\microsoft visual studio 10.0\vc\include\cerrno 14 Error 2 error C1083: Cannot open include file: 'errno.h': No such file or directory c...

How to generate a .torrent file in QT (C++) on S60 platform

I am developing an app using QT wrt that would include functionality monitoring how fast some one types (sms) on their mobile, log this to a file on the device (which file is then bencoded) and sent as a .torrent file. to a remote server * Having looked at symtorrent, a bit of the required functionality is implemented (torrent file creat...

How to force Windows Mobile device to use GPRS for internet connection

Hi! I'm on WiFi and EDGE/GPRS too. I'm using WiFi for debugging in Visual Studio 2008 but I want my app use EDGE/GPRS for internet connection (socket creation) not WiFi thx & bye, Attila ...

Boost crash when linking Visual Studio 2008 Express '/Mtd' setting.

TLDR Linking my fresh boost build with Visual Studio (/Mtd) causes boost to throw a 'bad_alloc' exception before entering the main function. Details I built the boost library using the instructions from the Getting Started instructions. After setting up the prerequisites I used the following build command: bjam -j8 --build-dir="C:\De...

Should I be doing anything to help manage linker namespace pollution WRT internal-use classes?

In a complex library or framework, there are obviously times when classes are needed purely internally, to implement higher level functionality. Often these internals are tightly coupled to how the internals work, so there is no point in making them available to users - all they could do with them is to try to tamper with your private i...

zlib compiling on windows 7 (x64)

Hi! I had compiled zlib on my comp to compile libxml (for collada dom). But I don't know which directories are supposed to be /lib and /include at compiling libxml. Sorry for my English and my noobinity :) Thx for the answers and the worthy time You have spent on answering me. ...

how to set system ip programatically

C++ how to programatically change system IP... and if the the account has Limited Rights how to use the password to perform the task ...