c++builder

Detecting external content with TEmbeddedWB or TWebBrowser

我们两清 提交于 2019-12-21 05:39:23
问题 I am trying to block anything external loaded by TEmbeddedWB or TWebBrowser (or TCppWebBrowser). I would like to block anything that is loaded from Internet including images, javascript, external CSS, external [embed] or [object] or [applet] or [frame] or [iframe], executing JavaScript that can load external content etc. This problem consists of 2 parts: putting web browser into "restrict all" (except basic HTML without images) and detecting if such content exists if external content is not

Static Virtual functions in c++

只愿长相守 提交于 2019-12-21 03:43:20
问题 I have a base class and a derived one and I want to change base functions while keeping them static as they should be passed to other functions as static. How can I do that? 回答1: The ATL framework gets around the limitation of no virtual statics by making the base class be a template, and then having derived classes pass their class type as a template parameter. The base class can then call derived class statics when needed, eg: template< class DerivedType > class Base { public: static void

Simplifying VCL thread wrapper code

人盡茶涼 提交于 2019-12-21 02:49:12
问题 I am using thread wrapper which checks if function which updates VCL (which also has some arguments) was called from main thread or not and then executes in within the context of Main thread always. It works but I want to make it simpler. The problem is that I have to repeat this code in every function which needs VCL synchronization which is prone to errors. Is there a way to make this wrapper simpler and more re-useable? Note that this particular wrapper only uses one parameter but there

C++ Builder or Visual Studio [closed]

点点圈 提交于 2019-12-20 09:50:59
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 months ago . I own a software development company. We develop software for other companies who brand under their name/titles. And we also have a couple self branded titles in the Accounting/ERP market. Our accounting software is roughly 60% of our business and written in C++ Builder.

pass parameter using system command

馋奶兔 提交于 2019-12-20 05:36:14
问题 I have an executable program that runs in several pc's in a network. At first it gets the host name (pc-001.. pc-013 etc). Then i need to mount a network drive (server1) on even pc's and (server2) on odds one based on its host name. My problem is that i use system call to run dos command 'net use' for example system ("net use x: \\\\server1\\shares /user:username pass"); How can i pass a variable to username? username is the host name which i know its value and pass is the same for all

Firemonkey: TGrid usage on Embarcadero C++ Builder XE3

佐手、 提交于 2019-12-20 04:27:12
问题 I'm try to build a tool that reads data from a database and displays it as a table using a TGrid in Firemonkey. I need to use different types of columns like TCheckColumn and TPopupColumn but can't find any good guide or example on how to use them in C++ Builder. Any way, I managed to understand the usage of the TStringColumn,TProgressColumn setting the Value of the cell in the TGrid's event onGetValue. Does any one of you know how to set the Value for columns of type TCheckColumn,

Strange C++ Builder Linker error DATA.BIND.OBJECTSCOPE.OBJ

☆樱花仙子☆ 提交于 2019-12-20 03:22:10
问题 So I recompiled a perfectly fine and working project and suddenly all I get is this linker error: [ilink32 Error] Fatal: Unable to open file 'DATA.BIND.OBJECTSCOPE.OBJ' The project is a C++ console application with VCL enabled and I have no idea where the DATA.BIND.OBJECTSCOPE.OBJ comes from. These are the headers I'm using. #include <windows.h> #include <tchar.h> #include <stdio.h> #include <vector> #include <vcl.h> #include <System.hpp> #include <System.IOUtils.hpp> #include <System.Zip.hpp

How to programmatically construct components at runtime using C++ Builder?

房东的猫 提交于 2019-12-19 19:55:31
问题 Very basic C++ Builder question. I want to create a TButton at runtime. I would have thought that the following code would do it, but I see no button on the form: __fastcall TForm2::TForm2(TComponent* Owner): TForm(Owner) { TButton* b = new TButton(this); b->Height = 100; b->Width = 100; b->Left = 0; b->Top = 0; b->Caption = "Testing"; b->Visible = true; b->Enabled = true; } Thanks for any help! 回答1: You need to set the button's Parent (the surface it displays on): b->Parent = this; 来源: https

C++ Builder bccarm error when calling std::vector::push_back with TObject descendant

喜欢而已 提交于 2019-12-19 11:15:11
问题 I have some simple C++ code which won't be compiled by the Clang based C++11 compiler bccaarm of C++ Builder 10.1 Berlin. This is the code: TComponent* Comp = new TComponent(this); std::vector<TComponent*> Comps; Comps.push_back(Comp); And this is the error: [bccaarm error] stl_iterator.h(963): rvalue reference to type 'value_type' (aka 'System: classes::TComponent * __strong') can not be bound to lvalue of type '__borland_class * isTObj __strong' (aka 'System::Classes::TComponent * __strong'

What's the scope of this string?

拈花ヽ惹草 提交于 2019-12-19 10:12:38
问题 If I have the following code: { UnicodeString sFish = L"FISH"; char *szFish = AnsiString(sFish).c_str(); CallFunc(szFish); } Then what is the scope of the temporary AnsiString that's created, and for how long is szFish pointing to valid data? Will it still be valid for the CallFunc function? Will it's scope last just the one line, or for the whole block? 回答1: The C++11 standard $12.2.3 says: When an implementation introduces a temporary object of a class that has a non-trivial constructor (12