c++builder-xe

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,

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

How to get a “simple” function pointer from a member function

冷暖自知 提交于 2019-12-13 05:03:31
问题 I'm having a problem with function pointers and nothing I found on the net helped me to solve this problem. I have a function from a C API which take a pointer of a void function : extern int APIFunction(int, void (*func)(int)); I have a class with the function I would like to put when I call the API function. class MyClass { public: void myFunction(int status, otherAPi arguments...); }; Then, I created a pointer to my member function and created a new instance of my class typedef void

Indi TIdSNMP : How use SendQuery

爱⌒轻易说出口 提交于 2019-12-12 01:42:24
问题 I made the following routine in c++builder Xe ( listing code 1 ), using the Indi component TIdSNMP to query an agent snmp. The call to SendQuery failed, the connection is ok but the agent always return nothing. I also try to query the agent using the method QuickSend ( listing code 2 ) and in this case this second routine work correclty, so I suppose I made some mistake using the first routine. Can someone tell me where I was wrong in the first routine ? Best Reagrds, Enzo Listing 1 void _

Are template arguments required everywhere when mentioning a template base class?

走远了吗. 提交于 2019-12-10 18:36:22
问题 Here's a simple template; template <class T> class tt { private: T x; public: tt() {x=0;}; Add(T p) {x += p;}; }; ... and then a subclass of it; class cc : public tt<int> { public: cc() : tt() {}; }; This compiles fine in VC, but not in C++ Builder (XE) where it gives a E2102 error. The C++ Builder compiler needs the following syntax on the constructor of the cc class to compile; cc() : tt<int>() {}; In fact, the C++ Builder compiler needs the template parameters repeated every time the tt

Keep the scrollbars hidden in a Delphi dbgrid (even on resize)

时光怂恿深爱的人放手 提交于 2019-12-10 03:00:47
问题 For our dbgrid we want the scrollbars to be constantly hidden. Since TDBGrid doesn't have a 'scrollbars' property, we use: ShowScrollBar(DBGrid1.Handle, SB_VERT, False); ShowScrollBar(DBGrid1.Handle, SB_HORZ, False); However when we resize the window (and the panel containing the dbgrid), for a second the scrollbars appear and becom hidden again only after recalling the two above methods. A solution is to call these methods in DrawColumnCell, but this causes flickering of the dbgrid, even

C++ Builder XE, Passing and handling user-defined messages

早过忘川 提交于 2019-12-09 01:54:34
问题 I am trying to learn how to pass and handle messages in a VCL forms app. I've been digging the internet for some time and found this Suppose I have a progress bar I want to update using messages (btw if there's any other better way, I am eager to hear it) So I made a simple project to test the stuff and here's what I have (RECEIVER is a name of a form with progress bar, SENDER is a button used to send messages, updBar is a function to update progress bar, and 123456 is a message ID I want to

IDE generated USEFORM macro calls changing their order

随声附和 提交于 2019-12-08 16:51:27
问题 We have a C++Builder XE project (VCL Forms Application) that has a few dozen forms and units in it. Whenever a file belonging to the project is added, deleted, or renamed, the IDE should do two things: A call to USEFORM macro is added to or altered in the Project Source file (ProjectName.cpp) if the affected unit is a form or frame A CppCompile element in the project file (ProjectName.cbproj) is added or altered However instead of just doing the necessary changes, the IDE shuffles some of the

How to adjust DBGrid columns width automatically

江枫思渺然 提交于 2019-12-08 09:50:08
问题 I've been try to use this Delphi code with C++ Builder XE. I manually convert the language into C++ Builder language. This procedure was working correctly. When I try to maximize the form holding the DBGrid, this procedure successfully split the columns width according to the grid width. However, if I try to minimize the form width using mouse control at the right or left of form, this procedure weren't adjust the column width to the length of the values or length of the labels on each

“Unable to perform link” error when compiling in RAD Studio XE8

旧街凉风 提交于 2019-12-07 14:41:02
问题 The compiler is giving me an error (shown in the pic) even if I run the IDE as an administrator. Can anyone help to solve the problem? 回答1: Your linker is trying to allocate 128 MB of memory. The following info from Embarcadero was recently posted on the Embarcadero forums: Error detected (LME288) in Seattle 10 update 1 The error is an "out of memory", error. The reason for "Out Of Memory" errors (which come in different guises) in the linker, is that the linker has to pre-allocate memory in