c++builder

Masking floating point exceptions with Set8087CW, SetMXCSR and TWebBrowser

点点圈 提交于 2019-11-28 10:11:47
As I am receiving "Floating point division by zero" exception when using TWebBrowser and TEmbeddedWB from time to time, I discovered that I need to mask division by zero exceptions Set8087CW or SetMXCSR. Q1: What would be the best approach to do this: to mask such exceptions early in the application startup and never touch them again (the app is multithreaded)? to use OnBeforeNavigate and OnDocumentComplete events to mask / unmask exceptions? (is there a chance that exception could occur after the document is loaded?) Q2: What would be the best "command" to mask only "division by zero" and

Benchmarking affected by VCL

邮差的信 提交于 2019-11-28 09:59:31
问题 Today I ported my old memory benchmark from Borland C++ builder 5.0 to BDS2006 Turbo C++ and found out weird thing. exe from BCB5 runs OK and stable exe from BDS2006 measure OK only before main Form is started (inside its constructor) and if the benchmark is started again after main form is Activated or even after any VCL component change (for example Caption of main form) then the speed of benchmark thread is strongly affected. After some research I found out that: Does not mater if test is

Cross thread communication in Delphi

你离开我真会死。 提交于 2019-11-28 07:05:06
Is there any documentation on cross thread communication in Delphi? How can I send message to the thread that doesn't have a window? mghie You can only send (Windows) messages to threads that implement a standard message loop, which will automatically be created once a window handle is realized. It is however not necessary to use messages to communicate with a thread. Just let it wait on an event object (TEvent in VCL), and signal this event when you want the thread to perform a function. But if you are new to multi-threading - don't go into all these details on your own, unless you want to

How can I enable DEP/NX and ASLR on a Delphi 2006 or earlier executable?

若如初见. 提交于 2019-11-28 07:03:17
Delphi 2007 (and newer) supports enabling DEP and ASLR via any of these three techniques: add the command-line switch –dynamicbase when compiling with dcc32 add the preprocessor command {$DYNAMICBASE ON} to the source code manually OR in the bit in the header, with {$SETPEOPTFLAGS $40} in the source code I'd like to be able to do the same thing with Delphi 2006 and C++ Builder 2006 (aka BDS 2006). Does anyone know how to do this? Set PE flags You can use {$SetPEOptFlags $40} to set the DEP flag, and {$SetPEOptFlags $100} to set the ASLR flag. To set both use {$SetPEOptFlags $140} . If you have

C++Builder: Create a TForm with BorderStyle bsNone that is nevertheless movable and resizable

て烟熏妆下的殇ゞ 提交于 2019-11-28 06:07:41
问题 I'd like to have a TForm with BorderStyle = bsNone (no borders, no caption), which is nevertheless resizable and movable. I already figured out how to do the resizable part, but I'm stuck with getting it movable. /** * Overrides standard CreateParams method to create a TForm with BorderStyle * bsNone but is nevertheless movable and resizable **/ void __fastcall CreateParams(TCreateParams &Params) { BorderStyle = bsNone; TForm::CreateParams(Params); //set flag WS_EX_STATICEDGE //for more

C++ Builder XE7 LME288 Error

我怕爱的太早我们不能终老 提交于 2019-11-28 04:41:23
Suddenly, out of the blue, I get the LME288 linker error. [ilink32 Warning] Warning: D:/Projects/TrainFever Game Manager/TFGM/Win32/Debug/TFGameManager.ilc: 0x00010000 / 0x08000000 [ilink32 Warning] Warning: D:/Projects/TrainFever Game Manager/TFGM/Win32/Debug/TFGameManager.ild: 0x00010000 / 0x08000000 [ilink32 Warning] Warning: D:/Projects/TrainFever Game Manager/TFGM/Win32/Debug/TFGameManager.ilf: 0x00010000 / 0x0a000000 [ilink32 Warning] Warning: D:/Projects/TrainFever Game Manager/TFGM/Win32/Debug/TFGameManager.ils: 0x0003b000 / 0x08000000 [ilink32 Warning] Warning: unknown heap name :

Late Binding COM objects with C++Builder

拥有回忆 提交于 2019-11-28 04:25:54
问题 We're interfacing to some 3rd party COM objects from a C++Builder 2010 application. Currently we import the type library and generate component wrappers, and then are able to make method calls and access properties in a fairly natural way. object->myProperty = 42; object->doSomething(666); However, we've been bitten by changes to the COM object's interface (which is still being extended and developed) causing our own app to fail because some method GUIDs seem to get invalidated - even if the

'cannot find or open the pdb file' Visual Studio C++ 2013

南楼画角 提交于 2019-11-28 03:48:31
I just downloaded VS 2013 Community Edition and I wrote my first app. When I run it it shows in the output section: 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Users\Toshiba\Documents\Visual Studio 2013\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe'. Symbols loaded. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or

Rotating a square TBitmap on its center

孤街醉人 提交于 2019-11-28 02:27:11
I am trying to find the simplest way to rotate and display a TBitmap on its center by any given angle needed. The TBitmap is square and any clipping that might occur is not important so long as the rotated bitmap's center point remains constant. The image is very small, only around 50 x 50 pixels so speed isn't an issue. Here is the code I have so far which rotates a TBitmap to 90 degrees, which is simple, the any angle thing less so. std::auto_ptr<Graphics::TBitmap> bitmap1(new Graphics::TBitmap); std::auto_ptr<Graphics::TBitmap> bitmap2(new Graphics::TBitmap); bitmap1->LoadFromFile("c:

Adding additional library and include paths when compiling from command line

不羁岁月 提交于 2019-11-27 14:49:11
问题 I'm trying to add additional paths to be used by my project group during compilation. Since C++ Builder 2010 uses msbuild I have tried looking at the documentation for that and according to what I can find AdditionalLibPaths should be passable as a property. i.e msbuild /p:AdditionalLibPaths=C:\FooBar\Libs /t:build foo.groupproj But it doesn't seem to use the paths I added. I have previously noticed that some property names differ between VC++ and C++ Builder when passed to msbuild and wonder