c++builder

TImageList - True color + alpha channel vs. 8-bit (256 colors)

空扰寡人 提交于 2019-12-24 14:54:11
问题 I use c++ Builder 2009 but I tagged this for Delphi as well since I expect the exact same issue to exist there as well. I use TImageList (16x16) and associate it to TListView (SmallImages) and TTreeView . I was adding new icons via the IDE (design time) and imported some 16x16 True color + alpha channel icons. In the IDE they looked fine: During run time, they do not look fine at all: Notice the edges especially. The top icon is icon 5 and the bottom icon is icon 7. See how they are supposed

ProcessMessages on OnShow Event c++ builder

一世执手 提交于 2019-12-24 14:52:10
问题 I'm using c++ builder (bcb6) and on: FormShow event there is: Application->ProcessMessages I would like to know what exactly the responsibility of: Application->ProcessMessages What exactly it did? and when we shall use by that? when it can cause exp.? Thanks! 回答1: The BDS 2006 IDE help states for Application->ProcessMessages this: Interrupts the execution of an application so that it can process the message queue. Call ProcessMessages to permit the application to process messages that are

Draw tbitmap with scale and alpha channel faster

我的未来我决定 提交于 2019-12-24 09:27:33
问题 The following code copies a large bitmap blends it with the correct background and then draws a semi transparent image with a clipped region to save draw time... Images are in an array and prescaled... This has been through several levels of optimization based on my limited knowledge of C++ and the Builder graphics... Edit: Updated code... blend(); void blend(Graphics::TBitmap *dst,int x,int y,Graphics::TBitmap *src,BYTE alpha) { const int n=3; // pixel align [Bytes] int dx0,dy0,dx1,dy1, //

TEdit Input Validation on C++ Builder XE8

白昼怎懂夜的黑 提交于 2019-12-24 03:04:31
问题 I am very new to C++ Builder XE8. I want the minimum and maximum length of numbers that must be typed is as much as six numbers, also I need to make sure that only number is entered (0 is exception), and not an alphabetic character, backspace, punctuation, etc. I would also like to produce an error box if anything other than a number is entered. I've tried a few combinations of codes, three of which can be seen below, but none of those codes works. Any help would sure be appreciated! (1).

Using Frame Buffer Objects (FBO) in Borland C++ Builder 6

旧时模样 提交于 2019-12-24 03:03:27
问题 I have an "access violation" on the Frame Buffer Object (FBO)'s command glGenFramebuffersEXT : void TGLForm::DrawScene() { wglMakeCurrent(ghDC, ghRC); glEnable(GL_TEXTURE_2D); GLuint framebuffer, texturefbo; GLenum status; glGenFramebuffersEXT(1, &framebuffer); // access violation here Founding a help thread concerning the FBOs, I checked that the glext.h initialization were okay and repeated amidst the preprocessor lines this way : #include "glext.h" #include "wglext.h" extern

read gmail pop3 using c++ builder

被刻印的时光 ゝ 提交于 2019-12-23 23:09:05
问题 I want to read my Gmail inbox emails using c++ builder so I use this code I got it from videos on youtube, but before i read i tried to connect first using this code in the button. MyPoP3 POP3->Host = "pop.gmail.com"; POP3->Port = 995; POP3->Username = "@gmail.com"; POP3->Password = "my pass"; POP3->Connect(); Memo1->Text = "Number = " + IntToStr(MyPoP3->CheckMessages()) + "\n"; MyPoP3->Disconnect(); and i got this error message after a short delay. error connection closed gracefully this my

Is it valid for a C++ compiler to implicitly instantiate ALL member functions of a template class?

三世轮回 提交于 2019-12-23 19:42:06
问题 Suppose I have a public class and a private implementation class (e.g. PIMPL pattern), and I wish to wrap the private class with a template smart pointer class with a checked delete, as follows: PublicClass.h class PrivateClass; // simple smart pointer with checked delete template<class X> class demo_ptr { public: demo_ptr (X* p) : the_p(p) { } ~demo_ptr () { // from boost::checked_delete: don't allow compilation of incomplete type typedef char type_must_be_complete[ sizeof(X)? 1: -1 ]; (void

How to show a firemonkey form on second monitor

穿精又带淫゛_ 提交于 2019-12-23 19:02:37
问题 I am trying to display a FireMonkey form on a second monitor, using C++Builder with following code: void __fastcall ShowFormOnScreen( int OutMon ) { MyForm->Top = 0; MyForm->BorderStyle = bsNone; MyForm->WindowState = wsNormal; MyForm->Left = Screen->Monitors[OutMon]->Left; MyForm->Height = Screen->Monitors[OutMon]->Height; MyForm->Width = Screen->Monitors[OutMon]->Width; MyForm->Show(); } Unfortunately, the Screen object does not have the Monitors property, so how can do this in FireMonkey?

How to access COM objects from different apartment models?

三世轮回 提交于 2019-12-23 17:04:10
问题 I have a multi-threaded C++Builder GUI app, which communicates with a third-party app via COM. I need to call methods of the COM object from several threads, and I'm protecting access with a mutex. Apparently, the main GUI thread must use STA model, but my worker threads need to use MTA. The COM object is constructed in an MTA thread. Everything works fine except access to the COM object from the GUI thread, due to the MTA/STA mismatch. I've read a bit about marshalling, but haven't tried to

How to call static method from another class?

喜欢而已 提交于 2019-12-23 15:08:55
问题 I am trying to call a static method from a.h to b.cpp. from what I have researched, it is as simple as just putting a :: scope resolution but however I tried and it throws me an error "C++ requires a type specifier for all declarations". below is what I have. a.cpp float method() { //some calculations inside } a.h static float method(); b.cpp a::method(); <- error! "C++ requires a type specifier for all declarations". but if I type without the :: a method(); <- doesn't throw any errors. I