c++builder

Border around a form with rounded corner in c++ builder XE

别等时光非礼了梦想. 提交于 2019-12-06 02:12:32
问题 I have made a C++ Builder XE form with rounded corner with the help of the following code BorderStyle = bsNone; void __fastcall TForm1::FormCreate(TObject *Sender) { HRGN frmrgn; frmrgn = CreateRoundRectRgn (0, 0, ClientWidth, ClientHeight,12,12); SetWindowRgn(Handle,frmrgn,true); } It looks cool but the border is missing, I tried many thing but not get good result so please help me to draw border of color RGB(96,96,96) And I want to make whole form dragable. 回答1: 1. Painting a dark grey

Is there a way to write a BSTR literal?

China☆狼群 提交于 2019-12-05 18:08:58
When calling a function that expects a BSTR it'd be nice to be able to write something like: iFoo->function( bs"HELLO" ); However the only workaround I'm aware of is to use a wrapper that calls SysAllocString etc., e.g.: iFoo->function( WideString(L"HELLO").c_bstr() ); which is kind of ugly. Is there actually such an option to create a BSTR literal? Motivation: easier-to-read code, and faster runtime performance by avoiding an allocation and deallocation. Clarification: I am only talking about situations where the caller (i.e. us) has ownership of the BSTR, for example: calling a function that

What happened to TBitBtn and TButton inheritance chain?

旧街凉风 提交于 2019-12-05 12:29:58
I've recently began to upgrade my RAD Studio 2007 project to RAD Studio 2009. One thing I noticed is when seemingly simple code all of a sudden failed to compile. Example Code: class CButtonPopupMenu { // Snip public: void Init( TButton* SrcButton ) { SrcButton->OnClick = OnButtonClick; } private: void __fastcall OnButtonClick( TObject* Sender ) { // Do some button click stuff } }; // Snip TButton button = new TButton( this ); TBitBtn bitBtn = new TBitBtn( this ); CButtonPopupMenu popupButton = new CButtonPopupMenu( button ); CButtonPopupMenu popupBitBtn = new CButtonPopupMenu( bitBtn ); This

Destructors and inheritance in C++?

梦想与她 提交于 2019-12-05 11:23:41
I use Borland C++ Builder. And i had o problem #include <Classes.hpp> class TMyObject : public TObject { __fastcall TMyObject(); __fastcall ~TMyObject();//I would like to inherite my destructor from TObject }; __fastcall TMyObject::TMyObject() : TObject()//it will inherited my constructor from TObject { } And for that new destructor that will inherite ~TObject ? __fastcall TMyObject::~TMyObject????????????? This can be solved at TObject 's level. Its destructor has to be virtual: #include <Classes.hpp> class TObject { __fastcall TObject(); virtual __fastcall ~TObject(); }; This way you can

Loading and Saving vectors to a file

会有一股神秘感。 提交于 2019-12-05 09:26:14
问题 I am using C++ Builder and I have a vector array of Appointment objects. I want to save it to and load it from a file. Currently, I am using ifstream and ofstream with binary files. I have a header that contains the size of the vector that will be saved alongside the data, so as to know its size when loading. Is serilization a better way to do this? If so, do I need to use the boost library, or another way? Here is my current code: class appointment { public: appointment(); appointment

c++ Builder xe5 Error detected (LME288)

∥☆過路亽.° 提交于 2019-12-05 04:45:09
c++ Builder xe5 [ilink32 Error] Error: Unable to perform link [ilink32 Warning] Warning: Error detected (LME288) that happened when i tried to compile a test project c++ builder xe5 on windows xp Barry Andrews I got some information on this from Embarcadero which may help. The error is an "out of memory", error. The reason for "Out Of Memory" errors (which come in different guises) in the linker, is that the linker has to pre-allocate memory in contiguous heaps that it then uses as it links, in the past these heaps could not be adjusted, we had to do a best guess, so in the new 64-bit linker

Running VCL in a separate thread

筅森魡賤 提交于 2019-12-05 03:37:23
问题 I now have a rather rare situation. I have an application which directly interacts with Windows' message queue. This application also runs external Lua scripts with LuaJIT. I wanted to have a debugging facility for these scripts, so I've created a plain VCL application, and then converted it into a DLL library. When the first application starts a debugging session with the library, this DLL creates a separated thread, where the whole VCL facility is initialized and run. procedure

FindNextFile fails on 64-bit Windows?

谁说我不能喝 提交于 2019-12-05 00:44:50
using C++Builder 2007, the FindFirstFile and FindNextFile functions doesn't seem to be able to find some files on 64-bit versions of Vista and XP. My test application is 32-bit. If I use them to iterate through the folder C:\Windows\System32\Drivers they only find a handful of files although there are 185 when I issue a dir command in a command prompt. Using the same example code lists all files fine on a 32-bit version of XP. Here is a small example program: int main(int argc, char* argv[]) { HANDLE hFind; WIN32_FIND_DATA FindData; int ErrorCode; bool cont = true; cout << "FindFirst/Next demo

HTML Editor for CBuilder/Delphi

别说谁变了你拦得住时间么 提交于 2019-12-05 00:31:42
问题 I need to find basic WYSIWYG HTML editor component for C++Builder 5 to let users to create some simple text that I will paste into existing HTML page template. Just a simple support to create links, add images, use headers/bold/italic. 回答1: You can drop a TWebBrowser on a form and enable designmode on it, like this: // Delphi code.. (WebBrowser1.Document as IHTMLDocument2).designMode := 'on'; After executing the above line, the page will be editable. You can type extra text, delete, etc. If

Enable Safe Exception Handling in C++ Builder

北战南征 提交于 2019-12-05 00:10:06
For Windows 8 application certification, there are (among other) these requirements: 3.2 Your app must be compiled using the /SafeSEH flag to ensure safe exceptions handling 3.3 Your app must be compiled using the /NXCOMPAT flag to prevent data execution 3.4 Your app must be compiled using the /DYNAMICBASE flag for address space layout randomization (ASLR) I wasn't able to find out how to enable either of these in C++Builder XE. For /NXCOMPAT and /DYNAMICBASE , one can use editbin.exe from VS or peflags.exe from Cygwin. Though I would feel more confident about possible side-effects, if there