Jump to content

Search the Community

Showing results for tags 'c++'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 8 results

  1. Hello everyone, I am a technician in a company who is making business in Healthcare material. A long time ago, an employee programmed softwares for this company with Delphi 2009. Due to bugs we begin to have, I am in charge to upgrade the apps. But my boss doesn't want Delphi but C++. So I would like to know if I can import the source project into RAD Studio and convert it in C++ to upgrade it. I also began a new app in Delphi but my boss really wants C++, he thinks that Delphi is not good (because he has a friend who is programmer and said Delphi sucks ... very open-minded programmer, indeed). So I need your help to convert all stuff I have in Delphi to C++. It's fine if it's not perfect, I know that I will need to adapt many things, I just don't want to begin with a blank project. I wish you an exellent day and I am waiting for your replies !
  2. I am trying to make an api post request using Delphi. I have the working example in c++ but cannot figure what I am doing wrong when I convert it to Delphi code. I posted my original question on Stackoverflow here: https://stackoverflow.com/questions/74521060/converting-c-api-post-request-into-delphi-code C++ Code: CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://sandbox.checkbook.io/v3/check/digital"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "accept: application/json"); headers = curl_slist_append(headers, "content-type: application/json"); headers = curl_slist_append(headers, "Authorization: xxxxxxxxxxxx:xxxxxxxxxxxxx"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"recipient\":\"testing@checkbook.io\",\"name\":\"Widgets Inc.\",\"amount\":5,\"description\":\"Test Payment\"}"); CURLcode ret = curl_easy_perform(hnd); My Delphi Code: unit API_InvoiceCloud; interface uses DB, SysUtils, System.Classes, System.JSON, IdSSLOpenSSL, VCL.Dialogs, IdHTTP, XML.XMLIntf, xml.xmlDom, xml.XMLDoc, IDCoder, IDCoderMIME, IdBaseComponent, IdException, IdZLibCompressorBase, IdCompressorZLib, Rest.Client; procedure CreateDigitalPayment_CheckBookAPI(mRecipientEmailAddress, mRecipientName : String; mPaymentAmount : Double; mPaymentNumber, mPaymentDescription : String); implementation var //{ INDY COMPONENT TO CONNECT TO API SERVER; MAKES CONNECTION } IDHTTP1 : TidHttp; //{ SSL Connection } SSL : TIdSSLIOHandlerSocketOpenSSL; //{ Request and Response vars } JsonRequest, InJson : String; JsonToSend : TStringStream; //object to store json text and pass API JObj : TJSONObject; Const //{ Constant variables holding the APIKEY+APISECRET and BASEURL } nBASEURL = 'https://sandbox.checkbook.io/v3/check/digital'; nAPIKEY = 'xxxxxxxxx:xxxxxxxx'; procedure CreateDigitalPayment_CheckBookAPI(mRecipientEmailAddress, mRecipientName : String; mPaymentAmount : Double; mPaymentNumber, mPaymentDescription : String); var //{ Response into String } ResponseCode : String; { -----------Testing---------- } //lParamList: TStringList; nBASEURL : String; RequestBody : TStream; ResponseBody : String; begin CodeSite.EnterMethod('DigitalPayment_CheckBookAPI'); nBASEURL := 'https://sandbox.checkbook.io/v3/check/digital'; //{ JSON body with request string } JsonRequest := '{"recipient":"' + mRecipientEmailAddress + '","name":"' + mRecipientName + '","amount":' + FloatToStr(mPaymentAmount) + ',"number":"' + mPaymentNumber + '","description":"' + mPaymentDescription + '"}'; try try //{ Create connection instance } IDHTTP1 := TidHttp.Create; //{ SSL Configuration } SSL := TIdSSLIOHandlerSocketOpenSSL.Create; SSL.SSLOptions.SSLVersions := [sslvTLSv1_1, sslvTLSv1_2]; IDHTTP1.IOHandler := SSL; //{ Headers/Params } IDHTTP1.Request.Clear; IDHTTP1.Request.CustomHeaders.FoldLines := False; IDHTTP1.Request.Accept := 'application/json'; IDHTTP1.Request.ContentType := 'application/json'; IDHTTP1.Request.CustomHeaders.Values['Authorization'] := nAPIKEY; //{ Saving JSON text to TStringStream Object } JsonToSend := TStringStream.Create(JsonRequest, TEncoding.UTF8); //JsonToSend := TStringStream.Create(JsonRequest, TEncoding.ASCII); //{ Making POST Request using INDYs TidHTTP component; Params are: URL, JsonStringObj - saving into variable } SinglePartyResponse := IDHTTP1.Post(nBASEURL, JsonToSend); ShowMessage(IDHTTP1.ResponseCode.ToString); except on E : Exception do //{ Display error message if cannot do API CALL } begin ShowMessage(E.ClassName+' error raised, with message : "' + E.Message + '".'); Abort; end end; finally //{ Free objects from memory } IDHTTP1.Free; SSL.Free; JsonToSend.Free; end; end; end. Any help is appreciated, thanks!
  3. We started porting the Skia4Delphi library to C++Builder and we came across a problem in the static linking of objects, specifically linking the file “/usr/lib/clang/lib/darwin/libclang_rt.ios.a” which is in the SDK path (ex: “C:\Users\<username>\Documents\Embarcadero\Studio\SDKs\iPhoneOS15.2.sdk\usr\lib\clang\lib\darwin\libclang_rt.ios.a”) In Delphi, this linking is very simple to do. We can simply declare a fake method and add the external '/<sdk_sub_path>/<filename>.a', which is exactly what we do in our Delphi implementation: procedure libcompiler_rt; external '/usr/lib/clang/lib/darwin/libclang_rt.ios.a'; In C++Builder however, we didn't find anything similar. So far we've only been able to force this link in two different (but very rudimentary) ways: Method 1 - Configuring project linking: Adding to the project library path “$(BDSPLATFORMSDKSDIR)\<DefaultPlatformSDK>\usr\lib\clang\lib\darwin\” Note: This is necessary because although some SDK paths are automatically passed to the linker, this is not. Adding the command -lclang_rt.ios to the project link The problem with this method is that apparently there is no environment variable for the <DefaultPlatformSDK>, and adding only relative paths, in this case “\usr\lib\clang\lib\darwin\”, doesn't work. We also tried “$(SDKROOT)\usr\lib\clang\lib\darwin\” but to no avail. Method 2 – Adding objects to the project Directly add the file “libclang_rt.ios.a” to the project. It also works, but this is also a bad option. Questions Is there any other way to force link an SDK object in C++Builder? It would be nice to have a simple solution that requires no configuration: #pragma link "/usr/lib/clang/lib/darwin/libclang_rt.ios.a" // But this don't work Would there be any variables we could use to represent the path of the SDK being used? (Ex: “$(SDKROOT)\usr\lib\clang\lib\darwin\”)
  4. Has anyone got Google Tests (unit testing framework) working with Embarcadero C++ clang compiler? if so, using clang32 or clang64 bit? [or, ideally, both?] I can't find any web documentation that tells me if this is currently possible (Embarcadero 10.4.1) or not. (If there is a helpful URL then I would be grateful if anyone can oblige).
  5. Bogdan Grabinski

    64 bit PostgreSQL and Embarcadero ???

    I am back from Borland C++ Builder 5, skipped 10 years, and now on Embarcadero C++ Builder 11 PRO. I my have annoying questions with all good intentions of better tools. To the point. Attempting to access PostgreSQL 13 installed on local Windows 10 development box, using FireDAC components with 64 bit VCL Windows desktop project. I am getting error message stating the I need 32 bit version of libpq.dll. I got semi smart and supplied path to 32 bit libpq.dll from older postgres version 10, and all started to work at design time. Unfortunately compiled version trow error that it need 64 bit version of libpq.dll. Is there smart workaround this circle of errors embarcadero put mi in? Hope it is just my 10 years of not using excellent productivity tool. Yes I attempted to access Postgresql 14.1 as well, same issue. That I got running 64 bit application. Is there separate path option for libpq.dll 32bit for design time, and 64 bit for rune time?
  6. I have a problem using the new v8 version of OverbyteICS with MimeDecode in my C++ project with Embarcadero XE10.3. In my old studio I was able to work with v5 using the TMimeDecode component after including MimeDec.hpp in the unit header file. In the unit cpp file I used #pragma link "MimeDec" to load the library., but in V8 I am not able to find the cpp header file in the extracted Source folder, only the delphi version (OverbyteIcsMimeDec.pas). Is it still possible to use the old methods connected to MimeDecode v5 (Method 'DecodeFile', field 'CurrentData', etc.) in the new Embarcadero XE10.3 (with OverbyteIcs v8)? Or is it maybe possible to use v5 with XE10.3? Whenever I click on the unit file in the project tree, I get a message signaling that the TMimeDecode component couldn't be found. I even tried to add the OverbyteIcsMimeDec.pas file as well as further needed *.pas files, but still the same error is shown. Is there anything else I need to do? The delphi compiler did generate the appropriate *.hpp files in my Embarcadero directory, which I did include in my project. I did also add include "OverbyteIcsMimeDec" to my unit header file, but without success. I would really apprecaite some help regarding my efforts to implement MimeDecodc during the migration process.
  7. Hallo to all, since 10.4 (and 10.4.1) debugging c++ DLL for x64 Windows S.O. is impossible (for me of course). ALL THE PROJECTS ARE COMPILED FOR X64. If I launch standard debug from Delphi project, the DLL source code (made in c++) is ignored and no breakpoints are used in the DLL. If I launch LLDB debug from c++ DLL (setting the correct host of course), an error like this is generated and the app doesn't start. If you launch the app with or without Delphi debugger all is working. Same situation with remote debugger (via "old style debugger" or paserver). Before LLVM all is working and i can debug DLL c++ code. I miss something or do something wrong ? Attached is a very simple project group to test. Thanks for your attention. Test.zip
  8. Check out how you can use Delphi's new Custom Managed Records feature to wrap C(++) APIs. https://blog.grijjy.com/2020/07/20/wrapping-c-apis-with-custom-managed-records/
×