c++builder

Calculate time between 2 TDateTime, with a twist

邮差的信 提交于 2019-12-11 14:09:43
问题 I need to find out how to get the time between 2 times, but only if it is within work hours(Stored in a database) This is what I got for now, but it is totally wrong. the total won't bee correct. int __fastcall Organisasjon::CalculateResponsetimeInOpeninghours(std::auto_ptr<DBCommand> cmd, long orgid, TDateTime starttimeIn, TDateTime endtimeIn) { int totalTimeInQueue = 0; String sIsWorkDay = ""; String s = "SELECT o.isworkday, o.workdate, o.workstarttime, o.workendtime " \ "FROM orgwdexcep o

Saving transparent (alpha channel) PNG from TImageList

孤者浪人 提交于 2019-12-11 13:42:57
问题 I have a TImageList which contains transparent icons (32bit, with alpha channel). What I want to do is to save individual icons based on image index as PNG file(s), while preserving alpha channel transparency. Using RAD Studio 2010 so it has TPngImage support, no need for third party libraries. Images are loaded into TImageList from PNG "sprite" image using the method here - Add a png image to a imagelist in runtime using Delphi XE - so the transparency is preserved upon loading. Now I need

Determine Height of text in TMenuItem to decide to what height to change the MenuItem via TMenuItem.OnMeasureItem

倖福魔咒の 提交于 2019-12-11 12:05:29
问题 I use Borland C++ Builder 2009 and when a large font is used, the Menu items in MainMenu and Popup are too close to each other, text cut off on top and bottom even, when too big. I understand I can change the height of the items with TMenuItem.OnMeasureItem but to what height should I set it ? What's the best way to calculate an ideal height and how do I get the variables for it (e.g. height of text)? 回答1: OnMeasureItem handlers suggests you default value in Height var parameter. You can

How do I open a new form with a button, using C++ Builder?

穿精又带淫゛_ 提交于 2019-12-11 11:19:53
问题 I have a program with Form1 and Form2. How can I open form2 from form1 clicking a button? 回答1: Just a little more info having this in your Project.cpp: Application->CreateForm(__classid(TForm2), &Form2); means that the form will be created when you start your application. if you want to create the form your self when clicking the button do the following TForm2 *Form = new TForm2( this ); Form->ShowModal(); if for instance you need to use a custom constructor you can also create a new form

How to setup a TIcon instance to support alpha channel icons (SupportsPartialTransparency)

泪湿孤枕 提交于 2019-12-11 10:39:50
问题 Using Borland C++ Builder 2009 I notice that when replacing images in a TImagelist, the alpha channel data gets corrupted somehow. TIcon *Icon = new TIcon() ; for (int x = 0 ; x < OS_Specific_count ; x++) { OS_xx_ImageList->GetIcon(x, Icon) ; Use_ImageList->ReplaceIcon(x, Icon) ; } delete Icon ; The problem is also described (+screenhots) in another Q ( TImageList - True color + alpha channel vs. 8-bit (256 colors) ) but I'm now trying to narrow things down with more specific questions. While

Why can't the Borland C++ Builder 5 command line compiler find my files?

让人想犯罪 __ 提交于 2019-12-11 10:14:59
问题 I have a bcb5 project group that I am trying to compile with make.exe. Make seems to run fine and generates a call to bcc32.exe, but that fails. Here is the call to bcc32.exe followed by the error. M:\projects\Project>"D:\Program Files\Borland\CBuilder5\Bin\bcc32.exe" -Od -H=.\obj_files\vcl50.csm -Hc -Vx -Ve -X- -a8 -5 -b- -k- -vi -c -tW -tWM -w -par -IP:\b5\crc32\ISC\;Query;Z:\Bin\;Help;pas;D:\PROGRA~1\Borland\CBUILD~1\bin\ ..\include;D:\PROGRA~1\Borland\CBUILD~1\bin\..\include\vcl

Build project package C++ Builder

耗尽温柔 提交于 2019-12-11 09:12:47
问题 I have written a GUI forms application in C++ Builder and am wanting to be able to run the .exe on another computer. I am getting some .bpl errors when trying to run the .exe on another computer. How can I combine all the required files into a 'package' such that the .exe can be run on computers that do not have the required files? I have done Project->Deployment and a list of files have appeared, including the .bpl file. However, what do I do from here? thanks 回答1: Your .exe has dependancies

Trouble using .NET DLL in Borland C++ Builder 4

和自甴很熟 提交于 2019-12-11 08:35:25
问题 I have created a COM callable DLL in C# .NET 2.0 and created a TLB from the assembly using the .NET regasm tool. In Borland C++ Builder 4.0 I go to Project->Import Type Library-> and find my DLL's type library there and click "Ok" to import it. BCB creates an HardwareCheck_TLB.cpp & HardwareCheck_TLB.h file. In a cpp file of the project I want to use the DLL I put: #include "HardwareCheck_TLB.h" at the top. Then in code if I try to declare an object of that type in code: IHardwareCheck hc =

Creating a button with which a running process can be killed or terminated

∥☆過路亽.° 提交于 2019-12-11 07:58:52
问题 I would like to add a button to my form with which a running process (loop which runs several thousand times) can be terminated if the user wishes to stop the process for any reason or load another file. The program has a part which performs an interpolation for multiple cases and creates and saves a text file for each case. Once the process is launched (this is done by pressing a button after the necessary files have been loaded), it starts running and cannot be stopped until it is completed

C++ Builder: Refresh FireMonkey Visual Component

我怕爱的太早我们不能终老 提交于 2019-12-11 07:32:57
问题 I have a problem with C++ Builder and FireMonkey. I am creating a mobile application connected with a Datasnap Rest WebService. Some requests are a little bit long so I want to display a waiting message. Here is my code: lbl_testConnexion->Text = "Please Wait..."; lbl_testConnexion->TextSettings->FontColor = TAlphaColorRec::Red; this->Invalidate(); //Call to the Web Service list<Colis>* l = WS->getListeColis("00DP0097"); lbl_testConnexion->Text = "Success!"; I tried functions Form->Invalidate