c++builder

Dynamic alocation an array of Images in C++ Builder

瘦欲@ 提交于 2019-12-25 14:04:03
问题 I want to make a game of BlackJack. I want to make a vector of images and when I press a button a new image shows up(need 2 or 3 images). After that I want to delete all of them in another button press. I try to declare an vector in main class(Unit1.h): class TForm1 : public TForm{ ... public: TImage* Images[]; And in Form1(Unit1.cpp): void __fastcall TForm1::Button1Click(TObject *Sender) { // i=1 is global Images[i] =new TImage(this); Images[i]->Parent=this; Images[i]->Picture->Bitmap->.../

Dynamic alocation an array of Images in C++ Builder

一个人想着一个人 提交于 2019-12-25 14:01:03
问题 I want to make a game of BlackJack. I want to make a vector of images and when I press a button a new image shows up(need 2 or 3 images). After that I want to delete all of them in another button press. I try to declare an vector in main class(Unit1.h): class TForm1 : public TForm{ ... public: TImage* Images[]; And in Form1(Unit1.cpp): void __fastcall TForm1::Button1Click(TObject *Sender) { // i=1 is global Images[i] =new TImage(this); Images[i]->Parent=this; Images[i]->Picture->Bitmap->.../

How to use TComInterface properly?

故事扮演 提交于 2019-12-25 04:53:32
问题 I would like to use TComInterface to replace raw pointer. My current code is: { TComInterface<IStoreNamespace> pStore; if (SUCCEEDED(CoCreateInstance(CLSID_StoreNamespace, NULL, CLSCTX_INPROC_SERVER, IID_IStoreNamespace, (LPVOID*)&pStore))) { if (SUCCEEDED(pStore->Initialize(Form1->Handle, 1))) { //pStore->CallOtherMethods... } } // Release()'d automatically? } If I understood correctly this overwrites the pStore pointer with new pointer so it doesn't call pStore->Release(); automatically

How to create an array of buttons on Borland C++ Builder and work with it?

折月煮酒 提交于 2019-12-25 04:22:05
问题 Specific question How to create an array of buttons on Borland C++ Builder and work with it? I'm using Borland C++ Builder 6 and Borland Developer Studio 2006 (Turbo C++ 2006). Purpose To work with a lot of buttons on a form just using a for loop with an index, for example, changing their caption, size and position. I know if I have a button called Button1 and inside a click event of this button if I create another button (through TButton *Button2 = new TButton(Form1) ), I can assign Button1

Resource compilation error (Bad character in source input)

99封情书 提交于 2019-12-25 02:37:12
问题 I have added text file with following content to the project: 1 24 "MyApplication.manifest" In the same folder there is also MyApplication.manifest file which is XML - this one: C++ Builder / Delphi 2010 application manifest template After I attempt to build resource from RC I get error - Bad character in source input(1) Any ideas why? RT_MANIFEST value is 24, but I am unsure what 1 is supposed to be. 回答1: I managed to find the answer myself so no answer necessary. The problem was, as usual

paintbox doesnt paint from timer method c++ builder borland

﹥>﹥吖頭↗ 提交于 2019-12-24 22:01:14
问题 I am using Borland C++Builder 6. I have two methods of the form: void __fastcall FDisplay::PaintBox1Paint(TObject *Sender) void __fastcall FDisplay::TimerLabelsViewTimer(TObject *Sender) In the first method I draw the coordinate system. and in the second method I did: PaintBox1->Canvas->MoveTo(693,201); PaintBox1->Canvas->LineTo(770,187); and the line doesn't appear on the coordinate system. my second question, how can I erase the line and return to the base paint? Should I do this? PaintBox1

Looking for non-rectangular panel VCL component [closed]

家住魔仙堡 提交于 2019-12-24 19:23:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Sometimes I want L-shaped, T-shaped, triangular, polygonal ... Free reusable component please . . . 回答1: It seemed to be too late, but I know a free one on the Angus's site.("Drawing Objects") . (I misunderstood what you need is like non-recutanglular form like TRzShapeForm from your question.) Sorry. (source:

Link error in Borland 6.0

拥有回忆 提交于 2019-12-24 18:20:27
问题 Got Link error (Fatal: Access violation. Link terminated) in Borland 6.0. How do I know what is the cause of it ? Is there any output file that I can open and get more informative message ? 回答1: You should be able to use the command line that gets passed to the linker to determine which .obj files are being passed to the linker. You can then include/exclude files to see when the error occurs. A number of linker problems have been fixed since BCB6, you may want to try the linker from a demo of

Tree Structure with TFrames

喜你入骨 提交于 2019-12-24 16:42:41
问题 sry i couldn't draw any better with paint. what i am trying to do here is create a tree structure (like the one in the picture) using TFrames. and basically when i press the + buttons, a new TFrame would be added to the tree. I am using C++ Builder, and I know how to do the adding of the TFrame, my problem is i don't know how to draw the green lines of the tree. thanks in advanced. 来源: https://stackoverflow.com/questions/9212994/tree-structure-with-tframes

Tree Structure with TFrames

ⅰ亾dé卋堺 提交于 2019-12-24 16:42:31
问题 sry i couldn't draw any better with paint. what i am trying to do here is create a tree structure (like the one in the picture) using TFrames. and basically when i press the + buttons, a new TFrame would be added to the tree. I am using C++ Builder, and I know how to do the adding of the TFrame, my problem is i don't know how to draw the green lines of the tree. thanks in advanced. 来源: https://stackoverflow.com/questions/9212994/tree-structure-with-tframes