Masking floating point exceptions with Set8087CW, SetMXCSR and TWebBrowser

Assuming that you have no need for floating point exceptions to be unmasked in your application code, far and away the simplest thing to do is to mask exceptions at some point in your initialization code. The best way to do this is as so: SetExceptionMask(exAllArithmeticExceptions); This will set the 8087 control word on 32 … Read more

Eclipse CDT: Unresolved inclusion of stl header

This allowed me to avoid Eclipse “Unresolved inclusion” error. In my case I had to find the location of the C++ vector header on my computer (which is a Mac): find /usr/local -name vector -print I found the correct include location in folder “/usr/include/c++/4.2.1”. Then I set my project eclipse settings like so: Project->Properties->C/C++ General->Paths … Read more

How can I “unuse” a namespace?

Nope. But there’s a potential solution: if you enclose your include directive in a namespace of its own, like this… namespace codegear { #include “codegear_header.h” } // namespace codegear …then the effects of any using directives within that header are neutralized. That might be problematic in some cases. That’s why every C++ style guide strongly … Read more

How to render an openGL frame in C++ builder?

easy, just use TForm::Handle as window handle … Here some ancient example of mine in BCB5 ported to BDS2006: //————————————————————————— #include <vcl.h> #pragma hdrstop #include “Unit1.h” #include <gl/gl.h> #include <gl/glu.h> //————————————————————————— #pragma package(smart_init) #pragma resource “*.dfm” TForm1 *Form1; //————————————————————————— int TForm1::ogl_init() { if (ogl_inicialized) return 1; hdc = GetDC(Form1->Handle); // get device context PIXELFORMATDESCRIPTOR pfd; … Read more

bds 2006 C hidden memory manager conflicts (class new / delete[] vs. AnsiString)

After extensive debugging i finely isolated the problem. Memory management of bds2006 Turbo C++ became corrupt after you try to call any delete for already deleted pointer. for example: BYTE *dat=new BYTE[10],*tmp=dat; delete[] dat; delete[] tmp; After this is memory management not reliable. (‘new’ can allocate already allocated space) Of course deletion of the same … Read more

Porting C++ Builder to Qt [closed]

for TStatusBar, use QStatusBar for TListBox, use QListBox (Q3ListBox in Qt4) or QListWidget TStringGrid and TSpeedButton apparently have no equivalent. Use Qt demo software to see what Qt toolkit proposes and find what you are looking for. For other classes (not mentioned by OP): for TCheckBox, use QCheckBox for TRadioButton, use QRadioButton for TComboBox, use … Read more