c++builder

C++Builder VCL array of buttons dynamically made each with his independent click action

烂漫一生 提交于 2020-01-05 10:22:05
问题 i have tried the following way but it doesn't seem to work and it is incomplete. void __fastcall TForm1::Button1Click(TObject *Sender) { TButton **ButtonArray = NULL; ButtonArray = new TButton*[5]; for(int x = 0; x < 5; ++x) { ButtonArray[x] = new TButton(this); ButtonArray[x]->Caption = (AnsiString)"teste " + x + " - " + (1+random(100)); ButtonArray[x]->Left = 25 + 4 * random(100); ButtonArray[x]->Top = 25 + 4 * random(100); } } Code compiles without problems, but no button seems to show.

Somthing confused with ole drag and drop implementation [closed]

元气小坏坏 提交于 2020-01-05 08:23:33
问题 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 . I wish to finish a little demo to implement OLE drag and drop(drag a file from my application to windows explorer). But here comes a problem:DoDragDrop return DRAGDROP_S_DROP which means the ole drag and drop operation has successfully done,but also get DROPEFFECT_NONE which means drop target cannot accept the

C++ convert UnicodeString into String

孤人 提交于 2020-01-04 15:57:50
问题 Please help me somebody to convert unicodestring into string This is how i am getting unicodestring UnicodeString _str = OpenDialog1->FileName; Or if it possible to write into file unicode string with ifstream or something like that? Thanks 回答1: Depending on your needs, assign the UnicodeString to an AnsiString or a UTF8String , and then write that to your file instead of the original UnicodeString itself: UnicodeString _str = OpenDialog1->FileName; AnsiString _astr = _str; Or: UnicodeString

Assign values to multiple edit boxes, given their names

旧街凉风 提交于 2020-01-03 20:57:19
问题 i am currently doing some programming in Borland C++ Builder 6. I have 24 edit boxes(a visual component, with a text field) and i want to insert some values in the boxes, now i do it like this: Edit1->Text=1; Edit2->Text=2; Edit3->Text=3; ... Edit24->Text=24; but i want to have something like this: for(int i=1; i<25;i++){ Edit"i"->Text=i; } i think i have to make an array of objects or something. Can any body help me with this? I don't have a lot of experience with objects and stuff like that

How to convert a returned Python dictionary to a C++ std::map<string, string>

岁酱吖の 提交于 2020-01-03 19:04:17
问题 I'm calling Python from C++, and trying to perform some data conversions. For example, if I call the following Python function def getAMap(): data = {} data["AnItem 1"] = "Item value 1" data["AnItem 2"] = "Item value 2" return data from C++ as: PyObject *pValue= PyObject_CallObject(pFunc, NULL); where pFunc is a PyObject* that points to the getAMap python function. Code for setting up pFunc omitted for clarity. The returned pointer, pValue is a pointer to a (among other things) Python

IdHTTP to ensure push data to Ubidots (FMX, WIN32)

岁酱吖の 提交于 2020-01-03 05:09:29
问题 I can push an encrypted piece of humidity data up to my Ubidots cloud database by simply loading the following url in a web browser: https://industrial.ubidots.com/api/v1.6/devices/MYDEVICENAME/?token=MYTOKENHERE&_method=post&humidity=15.9 When I do that, I get the success response in the browser window {"humidity": [{"status_code": 201}]} and the data shows up in my data table on Ubidots. Now, I want to do this from an FMX app (C++ on Win32) without a visible browser, and I would like to

UIFileSharingEnabled key in Info.plist

那年仲夏 提交于 2020-01-03 04:54:02
问题 I added the key UIFileSharingEnabled to my app's version info as described here so my users can save files to my apps documents folder. Works great in testing. Tried to upload to apple store with Application Loader and i'm getting an ERROR ITMS-90039: "Type Mismatch. The value for the Info.plist key UIFileSharingEnabled is not of the required type for that key. . I've googled and found where other folks had problems with it but none of their solutions helped. Here are the ways i've tried to

how to use InputBox in c++builder with multiple values

╄→尐↘猪︶ㄣ 提交于 2020-01-03 03:34:10
问题 How can I use InputBox to make it take 3 Values. I can make it show just one value by using code: String input[3]; input[0]= InputBox("paied check", "the value", ""); any help? 回答1: InputBox() does not support what you are asking for. It is designed for single-value input only. InputQuery() supports multi-value input, but only in C++Builder XE2 and later, eg: String prompt[3] = {"value 1:", "value2:", "value 3:"}; String input[3]; if( InputQuery("paied check", EXISTINGARRAY(prompt),

Using VCL Styles gives a exception / crash in TOpenDialog

≡放荡痞女 提交于 2020-01-03 02:41:13
问题 I am experiencing a crash / exception when using a simple TOpenDialog with VCL Styles enabled. Without the styles enabled, the dialog is of course working fine. The issue occurs with C++ Builder 10 and 10.1 Professional. To reproduce: create a simpe VCL Form that uses styles add a TComboBox, a TButton and a TOpenDialog to the form add the following code to the OnClick event for the button OpenDialog1->Execute(); for(int i=0; i<100; i++) ComboBox1->Items->Add("test text"); ComboBox1->ItemIndex

Threads in C++ builder [closed]

守給你的承諾、 提交于 2020-01-01 10:24:31
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am new to c++ builder and unfamiliar with the threading I was hoping someone could post an example or point me in the right direction. I have a form which loads the formShow() function in c++ builder. It does