c++builder-10.1-berlin

Use a non-class member as an event handler

為{幸葍}努か 提交于 2019-12-25 11:42:53
问题 I'm writing a DLL wrapper to a C++Builder VCL class. This is an extremely simplified example of the problem: typedef void __fastcall (__closure *TMyEvent)(int index); class TMyClass { public: TMyEvent OnMyEvent; }; void __fastcall myEventHandler(int index) { } TMyClass myClass; myClass.OnMyEvent = myEventHandler; ...and here is the problem: Normally myEventHandler is defined inside another class, but here it is defined as a global function. When I try to assign myEventHandler to myClass

C++ Builder bccarm error when calling std::vector::push_back with TObject descendant

喜欢而已 提交于 2019-12-19 11:15:11
问题 I have some simple C++ code which won't be compiled by the Clang based C++11 compiler bccaarm of C++ Builder 10.1 Berlin. This is the code: TComponent* Comp = new TComponent(this); std::vector<TComponent*> Comps; Comps.push_back(Comp); And this is the error: [bccaarm error] stl_iterator.h(963): rvalue reference to type 'value_type' (aka 'System: classes::TComponent * __strong') can not be bound to lvalue of type '__borland_class * isTObj __strong' (aka 'System::Classes::TComponent * __strong'

WebSocket connect to TIdHTTPServer, handshake issue

怎甘沉沦 提交于 2019-12-12 10:03:23
问题 I'm using C++Builder 10.1 Berlin to write a simple WebSocket server application, which listens on a port for some commands sent from a web browser, like Google Chrome. On my Form, I have a TMemo, TButton and TIdHTTPServer, and I have this code: void __fastcall TForm1::Button1Click(TObject *Sender) { IdHTTPServer1->Bindings->DefaultPort = 55555; IdHTTPServer1->Active = true; } void __fastcall TForm1::IdHTTPServer1Connect(TIdContext *AContext) { Memo1->Lines->Add(AContext->Binding->PeerIP);

C++ Builder bccarm error when calling std::vector::push_back with TObject descendant

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 13:41:32
问题 I have some simple C++ code which won't be compiled by the Clang based C++11 compiler bccaarm of C++ Builder 10.1 Berlin. This is the code: TComponent* Comp = new TComponent(this); std::vector<TComponent*> Comps; Comps.push_back(Comp); And this is the error: [bccaarm error] stl_iterator.h(963): rvalue reference to type 'value_type' (aka 'System: classes::TComponent * __strong') can not be bound to lvalue of type '__borland_class * isTObj __strong' (aka 'System::Classes::TComponent * __strong'

WebSocket connect to TIdHTTPServer, handshake issue

喜夏-厌秋 提交于 2019-12-06 11:19:11
I'm using C++Builder 10.1 Berlin to write a simple WebSocket server application, which listens on a port for some commands sent from a web browser, like Google Chrome. On my Form, I have a TMemo, TButton and TIdHTTPServer, and I have this code: void __fastcall TForm1::Button1Click(TObject *Sender) { IdHTTPServer1->Bindings->DefaultPort = 55555; IdHTTPServer1->Active = true; } void __fastcall TForm1::IdHTTPServer1Connect(TIdContext *AContext) { Memo1->Lines->Add(AContext->Binding->PeerIP); Memo1->Lines->Add( AContext->Connection->IOHandler->ReadLn(enUTF8)); Memo1->Lines->Add( AContext->Data-

C++ Builder bccarm error when calling std::vector::push_back with TObject descendant

强颜欢笑 提交于 2019-12-01 12:24:34
I have some simple C++ code which won't be compiled by the Clang based C++11 compiler bccaarm of C++ Builder 10.1 Berlin. This is the code: TComponent* Comp = new TComponent(this); std::vector<TComponent*> Comps; Comps.push_back(Comp); And this is the error: [bccaarm error] stl_iterator.h(963): rvalue reference to type 'value_type' (aka 'System: classes::TComponent * __strong') can not be bound to lvalue of type '__borland_class * isTObj __strong' (aka 'System::Classes::TComponent * __strong') The compiler stops at line 963 in the file stl_iterator.h: The other C++ compilers bcc32 and bcc32c