c++builder

How can I visually design a component in C++ Builder?

风流意气都作罢 提交于 2019-12-10 15:26:30
问题 I have been away from C++ for a couple of years now doing AS3/Flex work. I have gotten used to being able to create a component and place it in design mode with very little fuss and I am struggling to get my head around the C++ Builder way of doing the same thing. I have written many components for C++ Builder in the past, but none of them have been visual. What I would like to do now is create a component for customer search and another for order processing because I want to be able to

Cancel / abort creating a new form in Delphi / C++Builder?

六月ゝ 毕业季﹏ 提交于 2019-12-10 15:15:14
问题 Is there any way to cancel or abort form creation from within the form's OnCreate event handler or C++Builder constructor? Basically, I'd like to be able to call Close() from OnCreate or from the constructor and have it skip showing the form altogether. I have several forms that as part of their initialization may determine that they shouldn't be shown at all. (I realize that I could split apart this portion of the initialization or add extra checks from the calling form or similar, but if

How do I access Delphi Array Properties using RTTI

孤者浪人 提交于 2019-12-10 13:13:16
问题 I'm familiar with using Delphi RTTI to access "simple" properties (ints/enums/strings, etc) but I cannot grasp how to work with Array properties. I'm starting by looking for array equivalents for the GetPropValue/SetPropValue calls. I'd expect to see similar ones to these, but taking an extra "index" parameter, but can't seem to find anything in the typinfo unit help. 回答1: Arrays and array properties can't have RTTI for them up to D2009. But when Barry Kelly spoke at the Delphi Live

How to disable MouseWheel if mouse is not over VirtualTreeView (TVirtualStringTree)

谁都会走 提交于 2019-12-10 12:56:44
问题 TVirtualStringTree behaves by default if it is focused - it will scroll on mouse wheel even if mouse is not over control (except if it is over another TVirtualStringTree). Is there a quick and elegant way to disable this behaviour? I already did this with OnMouseWheel event and checking with PtInRect if Mouse.CursorPos if it is over a control but I have a feeling that there is a better way to do the same because this way I'd have to define a new event for each TreeView I add and also handle

Store a screen capture (Bitblt) in a memory buffer to send over IdTCPClient

让人想犯罪 __ 提交于 2019-12-10 12:17:59
问题 In c++ builder 6 on windows vista ... Graphics:: TBitmap * bmpscreencapture = new Graphics::TBitmap; bmpscreencapture-> Height = Screen-> Height; bmpscreencapture-> Width = Screen-> Width; HDC ScreenSrc = GetWindowDC (0); BitBlt (bmpscreencapture-> Canvas-> Handle, 0, 0, Screen-> Width, Screen-> Height, ScreenSrc, 0, 0, SRCCOPY); Canvas->Draw(10, 10, bmpscreencapture); ReleaseDC (GetDesktopWindow (), ScreenSrc); delete bmpscreencapture; I currently have a section of code for capturing the

Wrong overload selected for stream manipulator

吃可爱长大的小学妹 提交于 2019-12-10 11:46:42
问题 Here's the code: #include <iostream> #include <iomanip> #include <typeinfo> #if 0 std::ostream &foo(std::ostream &os, std::ios_base &(*x)(std::ios_base &), bool show_id = false) { if ( show_id ) os << "(" << typeid(x).name() << ") "; return os << x; } #endif template<typename T> std::ostream &foo(std::ostream &os, T const &t, bool show_id = false) { if ( show_id ) os << "(" << typeid(t).name() << ") "; return os << t; } int main() { foo(std::cout, std::hex) << 255 << std::endl; foo(std::cout,

Definitions of: AnsiString, WideString, String, char[], char*, BSTR,

偶尔善良 提交于 2019-12-10 11:38:02
问题 This is a followup to this question AnsiString is a class, too? And string ? It is a class? And a char[] ? Can we say a WideString is a wrapper over double-byte characters, AnsiString is a wrapper over single-byte characters, and char[] is an array of single-byte characters? string not so sure what it is... Not sure about the diferent kind of string types I have in Code Builder C++ 2007 available and its portability. 回答1: AnsiString is a class provided C++ Builder, std::string is class

Borland C++ Builder 6 and string concatenation

半世苍凉 提交于 2019-12-10 10:31:30
问题 I'm using Borland C++ Builder 6 to try to do some simple string concatenation. However, I have run into what I think is an interesting issue. Everything I am able to find online states that I should be able to do something as simple as this: String word = "a" + "b" + "c"; However, when I try to compile this code, I get an "Invalid pointer addition" error. I could go as far as assigning each part to its own variable and adding each of those together to get the desired output. However, I think

Use OpenSSL in C++Builder

蹲街弑〆低调 提交于 2019-12-10 10:23:42
问题 I'm compiling an app in C++Builder 10 Seattle, and trying to use OpenSSL for RSA work. I followed this tutorial: How to Use OpenSSL to Generate RSA Keys in C/C++ Here is the code: #include <stdio.h> #include <openssl/rsa.h> #include <openssl/pem.h> bool generate_key() { int ret = 0; RSA *r = NULL; BIGNUM *bne = NULL; BIO *bp_public = NULL, *bp_private = NULL; int bits = 2048; unsigned long e = RSA_F4; // 1. generate rsa key bne = BN_new(); ret = BN_set_word(bne,e); if(ret != 1){ goto free_all

Visual bug in Windows title bar with VCL Styles enabled application and display scaling

我与影子孤独终老i 提交于 2019-12-10 03:17:06
问题 Currently I am testing various aspects of VCL styles enabled applications. I noticed, that with Windows scaling higher than the default 96 dpi/100%, the icon and the title bar text of the VCL Form are too big in size - and both are to close together -, please see attached screenshots. This is especially true with higher scalings like 200% or 250% (e.g. used on 4K displays and Windows 10), but even with a scaling of 144 dpi/150%, the problem is already visible. This is true for all styles