c++builder

Use Delphi serialization via JSON with C++

泪湿孤枕 提交于 2020-01-16 18:14:09
问题 Knowing that C++ does not have reflection I had a look at Delphi techniques and found an example using the REST.JSON library for serialization: Convert Object to JSON ... Now I would like to use a Delphi class, which can be serializied and deserialized with the provided methods, in my C++ code: TFoo = class(TObject) private public Fa: Integer; Fb: Double; end; In the C++ unit the class is serialized and deserialized like this: #include <REST.Json.hpp> #include "TestJson.hpp" //Contains TFoo

Use a dll from a c++ program. (borland c++ builder and in general)

风流意气都作罢 提交于 2020-01-15 05:26:10
问题 I'm trying to use a dll, namely libcurl, with my program, but, it's not linking. Libcurl comes with .h files that I can include (takes care of dllimport), but then I guess I must specify which dll to actually use when linking somehow... How do I do that? I'm compiling with Borland C++ builder, but I really want to know how these things work in general... EDIT: This is the code (straight c/p from curl homepage) bool FTPGetFile::ConnectToFTP(string ftpServer){ CURL *curl; CURLcode res; curl =

C++ Builder - Difference between Lib and Res

萝らか妹 提交于 2020-01-15 01:25:18
问题 If my understanding is correct: * Classes compile into obj files. * Libs are collections of obj files. What are .res files? Are they like libs, or is there a difference? 回答1: .res files are compiled Windows resources (just like .obj are compiled C++ source code). They contain bitmaps, icons, etc. In particular, the C++Builder IDE will automatically maintain a .res file containing the application icon and version info that you've set up under Project -> Options -> Application and Project ->

C++ Builder - Difference between Lib and Res

别来无恙 提交于 2020-01-15 01:23:42
问题 If my understanding is correct: * Classes compile into obj files. * Libs are collections of obj files. What are .res files? Are they like libs, or is there a difference? 回答1: .res files are compiled Windows resources (just like .obj are compiled C++ source code). They contain bitmaps, icons, etc. In particular, the C++Builder IDE will automatically maintain a .res file containing the application icon and version info that you've set up under Project -> Options -> Application and Project ->

how get file properties with Firemonkey

≡放荡痞女 提交于 2020-01-14 05:45:05
问题 Using the GetFiles method of the TDirectory class (reference here) I can list files in my apps documents folder with the C++ Builder code below (works on mobile and desktop). Now, how can I also get details about the files such as size, date etc.? TStringDynArray list; TSearchOption searchOption; UnicodeString DocsPath; int lenDocsFolder; DocsPath = System::Ioutils::TPath::GetDocumentsPath(); lenDocsFolder = DocsPath.Length(); searchOption = TSearchOption::soTopDirectoryOnly; try { /* For

GetWindowRect has offset in Windows 10

倖福魔咒の 提交于 2020-01-11 05:45:07
问题 I use GetWindowRect in my program to get the coordinates of a window on the desktop. This works fine on a dozen or so PCs I have here for testing (XP-W8.1) but not on my one W10 PC with touch screen: the coordinates have an offset to the top-left. I googled both for a bug in Windows 10 and for something monitor related but cannot find anything, yet this seems like a commonly used function and the problem is easy to reproduce. Anyone got any clues? Code, simplified: hwnd = FindWindow(NULL,

example “virtual treeview” IterateSubtree in C++Builder XE-XE7

有些话、适合烂在心里 提交于 2020-01-07 22:59:35
问题 I need an example how to use "virtual treeview" IterateSubtree in C++ Embarcadero Xe1-7. I have the problem with this code: void __fastcall TMyForm::BuSearchClick(TObject *) { MyTreeView->IterateSubtree(NULL, SearchDataSomeId, (void*)&PNodeData, TVirtualNodeStates(), false, false); } void __fastcall TMyForm::SearchDataSomeId(TBaseVirtualTree*, PVirtualNode Node, void *Data, bool &Abort) { } The compiler gives the following error: [bcc32 Error] MyFile.cpp(363): E2034 Cannot convert 'void (

How to show a secondary form on taskbar using FMX C++?

廉价感情. 提交于 2020-01-06 23:43:42
问题 I'm with a little problem when trying to show more than one form on taskbar on the same time. I found I need to use the following: WS_EX_APPWINDOW So I search a little bit more about and then found it: class TForm2 : public TForm { __published: // IDE-managed Components private: // User declarations public: // User declarations __fastcall TForm2(TComponent* Owner); void __fastcall CreateParams(Controls::TCreateParams &Params); }; void __fastcall TForm2::CreateParams(Controls::TCreateParams

How to show a secondary form on taskbar using FMX C++?

孤街醉人 提交于 2020-01-06 23:43:14
问题 I'm with a little problem when trying to show more than one form on taskbar on the same time. I found I need to use the following: WS_EX_APPWINDOW So I search a little bit more about and then found it: class TForm2 : public TForm { __published: // IDE-managed Components private: // User declarations public: // User declarations __fastcall TForm2(TComponent* Owner); void __fastcall CreateParams(Controls::TCreateParams &Params); }; void __fastcall TForm2::CreateParams(Controls::TCreateParams

How to show a secondary form on taskbar using FMX C++?

左心房为你撑大大i 提交于 2020-01-06 23:43:13
问题 I'm with a little problem when trying to show more than one form on taskbar on the same time. I found I need to use the following: WS_EX_APPWINDOW So I search a little bit more about and then found it: class TForm2 : public TForm { __published: // IDE-managed Components private: // User declarations public: // User declarations __fastcall TForm2(TComponent* Owner); void __fastcall CreateParams(Controls::TCreateParams &Params); }; void __fastcall TForm2::CreateParams(Controls::TCreateParams