Jump to content

Search the Community

Showing results for tags 'delphi'.



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

Calendars

  • Community Calendar

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 226 results

  1. bonjours a tous je cherche le code source en delphi du projet :la gestion commercial du magasin et stock merci a l'avance mes amis
  2. Delphi 11, win7, office 2010, ms access I did not know anywhere else to post this and thought it best here. I use Office 2010, and when I open an Access database and proceed to open a text file for importing as a new Table or Linked source, it fails with the message "there is no object in this control" Also, when I proceed to open the Linked Table Manager, it also fails with the same message. After some time thinking about, and how it might have happened (I initially thought that Office got corrupt) I came to the conclusion that this happened when I installed Delphi 11.2 Alexandria because it uses the new Edge Browser components/dll's, etc., and that had to get installed which it installed, I think. Either way, I have to keep that installed in order to use Delphi 11 and/or some of the components. They appear to be necessary, so I'm stuck. It appears that I have lost some functionality in Access, like the above-mentioned, which I need and use regularly. Note, I use MS Access every day on this laptop. Does anyone know about this and how I can resolve that error message to get Access working correctly again ?
  3. Win7, D11.2, FMX app, using TStringGrid and FireDAC and SQLite In a near-perfect working database, it should never happen, but it could happen elsewhere, and since I have the issue now, I would like to know how to resolve this. I was doing some what-if scenarios and came upon this issue. I searched around here and elsewhere on the internet but I can not find the answer. In this scenario, I was adding a new record, which has an auto-increment field in this test database, IDNo -- ('IDNo INTEGER NOT NULL PRIMARY KEY,'). And it generated an error. Of course I understand why this happened, and can later figure out a method to avoid it from happening. But for now, i need to know how to resolve the "closed dataset" issue because I can't see the data any longer. I've tried closing the Query, and reopening it. And tried closing the Connection and reopening it too. But they are not working. When a database or dataset closes, how do I re-open it through code so that I can see the data again in the StringGrid?
  4. Issue/Problem: when deploying an app to android that has the: (camera, json, or barcode components on a form) the app starts up with a black screen flame and hangs and closes down. Has anyone tried the trial version of TMS FNC WX Pack Android? -- link: https://www.tmssoftware.com/site/tmsfncwxpack.asp I have been having a difficult time with the trial version v1.5.1.0 (via Getit) working on my smartphone with Android 10, using Delphi 11.2 Alexandria Professional under Windows 7 and also Windows 10 laptops. The trial version states to set it in release mode (For mobile device deployment, the trial version supports deploying in release mode only) which I have done, but after the app is deployed I still have a black screen with the Delphi flame and it eventually closes whenever click out of the screen. I am hoping that someone with similar experience knows how to resolve this issue. I would really appreciate the help. Thank you.
  5. 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!
  6. Hello girls and boys, I'm try to do a little app to read, post and delete my message in a forum. In forum, i'm like a "Moderator" (but not ADMIN privilegies! then I can post, edit, delete message (mine or from others)! the forum use old tech on server: -- Server: Microsoft-IIS/7.5 -- X-Powered-By: ASP.NET -- Content-Type: text/html; charset=utf-8 -- IP: v4 The answer from Indy "GET" method is a text/html with all necessary to show a "HTML page", but I would just get some data in this page, not whole page! -- NONE API is available to help me! then, just read the page-response!!! ------------------------------------------------------------------- Im using Delphi 10 and "INDY" (TIdHttp class). ``` AHttp := TIdHTTP.Create(nil); try try AHTTP.ReadTimeout := 10000; AHTTP.Request.ContentType := 'application/json'; // maybe other configurations, I dont know? AHTTP.Request.CharSet := 'utf-8'; AHTTP.Request.Accept := '*/*'; AHTTP.Request.BasicAuthentication := true; AHTTP.Request.Username := 'my user name'; AHTTP.Request.Password := 'my password'; ... // method GET... Memo1.Text := Http.Get(HTTP_DEFAULTPAGE); // **GET it's OK for now!!!** ... I would like use others: POST, UPDATE and DELETE except // showmessage... end; finally AHTPP.Free; end ----------------------------------- > resulted GET: 1) for now, I can get the "response" without problem, but the resulted is a "HTML" text. 2) I would like that was in JSON to catch the "key:value", but unfortunatelly ... many tags HTML default ... 3) If was possible "JSON pair", it would help me! it's possible? 4) if not, then is there some way to better get the "message titles", at least? ------------------------------------- NOTE: in my IdHttp, I always send my "username + password" like above! I would like edit a message: ---------------------------- 1) I type the topicID 2) I get the messsage (posted) in "edit" mode 3) I change the message content 4) I post the new message content I would like "add" a message: ----------------------------- I would like delete the message: ---------------------------------------- 1) I type the topicID 2) I send a "delete" command 3) then, the message would be deleted NOTE: -- Currently, to Delete any messages, I have that: 1) Edit the message to see the "button DELETE" (there is not a button before "Edit message" 2) on source of the page I see: <input type="submit" name="del" class="button" value='....'> to delete the current message for now it's only this. thanks
  7. I'm having trouble connecting to my DROPBOX account via TidHTTP and I don't know what to do anymore. I want to send a simple text file to DROPBOX in the first stage. procedure TForm2.btn1Click(Sender: TObject); const API_URL = 'https://content.dropboxapi.com/2/files/upload'; cFile = 'D:\testfile.txt'; var wAccessToken : string; Source: TFileStream; IdHTTP: TIdHTTP; Res : string; Ssl: TIdSSLIOHandlerSocketOpenSSL; begin wAccessToken := 'muj_token'; IdHTTP := TIdHTTP.Create(nil); try (* ShowMessage('Indy version: ' + IdHTTP.Version); RESULT MESSAGE : INDY 10.5.9.0 *) IdHTTP.HandleRedirects := True; ssl := TIdSSLIOHandlerSocketOpenSSL.Create(); ssl.SSLOptions.Method := sslvTLSv1_2; ssl.SSLOptions.Mode := sslmUnassigned; ssl.SSLOptions.VerifyMode := []; ssl.SSLOptions.VerifyDepth := 0; ssl.host := ''; Source := TFileStream.Create(cFile, fmOpenRead); IdHTTP.IOHandler := ssl; IdHTTP.Request.CustomHeaders.Values['Authorization'] := 'Bearer ' + wAccessToken; IdHTTP.Request.CustomHeaders.Values['Dropbox-API-Arg'] := '{ "autorename": false,"mode": "add","mute": false,"path": "/test.txt","strict_conflict": false}'; IdHTTP.Request.CustomHeaders.Values['Content-Type'] := 'application/octet-stream'; Memo1.Lines.Add(IdHTTP.Request.CustomHeaders.Text); Res := IdHTTP.Post(API_URL, Source); finally IdHTTP.Free; end; But after the POST command I get the error "error: 1409442E:SSL routines: SSL3_READ_BYTES:tlsv 1 alert protocol" - class EIdOSSLUnderlyingCryptoError with message "Error connectin with SSL" http://imgway.cz/m/hneT.jpg I don't know how to proceed, there is a stupid mistake somewhere. I found similar problems on https://stackoverflow.com/questions/1742900/tidhttp-in-indy-10 , https://stackoverflow.com/questions/7762584/post-problems-with-indy-tidhttp and many other forums. Somewhere it says it may be old INDY (which it is), but DROPBOX's probably has the TLS v1.2 required when TIDHTTP enables it ssl.SSLOptions.Method := sslvTLSv1_2 For the Request track, I stuck to the DROBOX.API structure DROPBOX API DOCUMENTATION https://www.dropbox.com/developers/documentation/http/documentation#files-upload Get access token for: ****************************************************** ************** curl -X POST https://content.dropboxapi.com/2/files/upload \ --header "Authorization: Bearer <get access token>" \ --header "Dropbox-API-Arg: {\"autorename\":false,\"mode\":\"add\",\"mute\":false,\"path\":\"/Homework/ math/Matrices.txt\",\"strict_conflict\":false}" \ --header "Content-Type: application/octet-stream" \ --data-binary @local_file.txt ****************************************************** ************** Even more information: Delphi XE3 Indy 10.5.9.0 with the exe I have the Open SSL files libeay32.dll (v. 1.0.2.17) and ssleay32.dll (v. 1.0.2.17) - but that will not be it. if I throw them away the error is the same DROPBOX requires TLS 1.2 from April On some forums they wrote the same error with old Open SSL files, old INDY, sending via TLS which is not supported by the addressee. But I don't feel either way. I downloaded Open SSL from https://github.com/IndySockets/OpenSSL-Binaries file openssl-1.0.2u-x64_86-win64.zip (I don't know if it's good, there are a bunch of them in the table with differences in the name "r", "s", "t", "u", he chose I'm the last one). Thanks for any advice.
  8. BennieC

    Listview Programming

    Good day I am trying to build an application which requires me to display multiple images in groups with selectable sizes. The images consist of a bitmap and a text field. My idea is to put the image groups in a TListview (Which I hope can display horizontally) and then add these listview groups into a TFlowlayout to manage the screen layout. However, I simply do not get it right to create a TListview item programmatically to display the image. I have tried to create a TListItemImage as well as simply adding a TListViewItem but neither worked in that I could see anything on the screen. I am including my test code (Note it pulls images from a folder for testing). The commented out sections will probably indicate some of the experiments that I tried. I will probably also struggle to add the TListviews to the TFlowlayout. Some advice will be much appreciated. The idea is that the application will run on both Android mobile as well as desktops. prjFlowLO.dpr prjFlowLO.dproj uFlowLOMain.fmx uFlowLOMain.pas
  9. Windows 7 Home 64bit Delphi XE7 Professional update 1 with FireDAC and Mobile add-on Indy version 10.6.1.518 Android version 10, (on smartphone) Android versions 4.4.4, and 4.4.2 (both on tablets) Issue/Problem: When I launch the app on Android, and click on the [Submit] button, the app shuts down when it tries to access the idhttp section here: idHttp1.get(url_address); It works fine under Windows FMX and VCL, just not Android. Can someone please help me resolve this? Thank you. History: Hi. I have been successfully creating small utility apps on my android devices (Galaxy S10+ (android 10) and tablets (android 4.x.x)) for the last 8 years. I've been playing around with a new windows project using API through OMdbAPI (an IMDB knock-off) to get quick movie/tv series info. The API is free for 1000 requests. I love it. It works well. Usage is simple, using the following -> [https://www.omdbapi.com/?t=Contact&apikey={8-dig-key-code}] as it will give back a JSON string (below), then I parse it to get back a two-column detail to visualize the data better. Later I plan to fine-tune it and display only certain info from it. Right now, I am simply debugging it on Windows 7 and Android. {"Title":"Contact","Year":"1997","Rated":"PG","Released":"11 Jul 1997","Runtime":"150 min","Genre":"Drama, Mystery, Sci-Fi","Director":"Robert Zemeckis","Writer":"James V. Hart, Michael Goldenberg, Carl Sagan","Actors":"Jodie Foster, Matthew McConaughey, Tom Skerritt","Plot":"Dr. Ellie Arroway, after years of searching, finds conclusive radio proof of extraterrestrial intelligence, sending plans for a mysterious machine.","Language":"English, Spanish, German, Russian","Country":"United States","Awards":"Nominated for 1 Oscar. 14 wins & 32 nominations total","Poster":"https://m.media-amazon.com/images/M/MV5BYWNkYmFiZjUtYmI3Ni00NzIwLTkxZjktN2ZkMjdhMzlkMDc3XkEyXkFqcGdeQXVyNDk3NzU2MTQ@._V1_SX300.jpg","Ratings":[{"Source":"Internet Movie Database","Value":"7.5/10"},{"Source":"Rotten Tomatoes","Value":"68%"},{"Source":"Metacritic","Value":"62/100"}],"Metascore":"62","imdbRating":"7.5","imdbVotes":"274,457","imdbID":"tt0118884","Type":"movie","DVD":"16 Dec 1997","BoxOffice":"$100,920,329","Production":"N/A","Website":"N/A","Response":"True"}
  10. I am trying to work out some issues with compiling certain components and need to list out all installations that pertain to Android development. I use the Android SDK tool to install various Android files. Although I can compile apps and deploy them to my Android device, I believe that I have messed things up pretty well, I think. F:\Users\Public\Documents\Embarcadero\Studio\15.0\PlatformSDKs\adt-bundle-windows-x86-20131030\sdk\tools\ --> Android Tools And I want to list out the same details seen below but in "text" format (so that I can post it to someone). I don't want to post it as an image like the below, plus also because there are a lot more info not seen in this image below and would require multiple images to post, and it would be better to post a text file and send that off to the person. Is there a command line tool that I can use to obtain the same text and layout? I can clean it up to look in a similar layout as in the image just above if I have to. Thanks.
  11. dkjMusic

    App is faster in IDE

    I am deveoping an app in Delphi 10.3 Community Edition. At one point the program retrieves equation parameters from a MS Access datbase and calculates x's and y's for a set of plots. It does this to produce 15 TCharts with 9 line series each. I have found that these operations often take much longer to execute when I run the standalone app as compared to running the app in the IDE. Below is a table of execution times (using GetTickCOunt). The columns are TChart graph #, milliseconds in the IDE, and milliseconds for standalone. # IDE SA -- --- ----- 1 703 14890 2 875 500 3 844 14828 4 829 14844 5 875 468 6 812 500 7 906 14859 8 1281 14813 9 938 14860 10 829 14875 11 15562 14844 12 937 14859 13 927 14860 14 812 531 15 828 14868 What could explain the differences in execution times and what can I do to decrease the times for the standalone execution?
  12. karl Jonson

    XML validation

    XML validation. I have an Object Pascal application which generates XML similar to this one: <book> <name>Anna Karenina</name> <author>Leo Tolstoy</author> <publisher>The Russian Messenger</publisher> <price>$16.79</price> </book> Which is the best way to add code which validates the above XML (in the generating app) ? I would like to make sure that: A book must have an author. A book price cannot exceed $100 TIA
  13. tinyBigGAMES

    GameVision Toolkit

    Ahh, finally at a point where I can start to update my GameVision framework to support modern PCs. This new generation will power upcoming game projects. I created a Facebook group for it, and I plan to post frequently about my progress. If you wish to follow, then you're invited to the cookout. Stop by and hang. Cold beer, burgers on the grill. LOL. https://www.facebook.com/groups/gamevisiontoolkit
  14. I gonna run python script in separate thread. My PythonEngine has IO field assigned with TPythonGUIInputOutput component What is the correct way to synchronize output (e.g. print("Hello World!") to Delphi's TMemo component? As far as I know VCL is not thread safe... Thank you.
  15. I have an XML file produced by Media Companion for a movie, I have used the Data Binding wizard to produce a schema from a dtd file. I can retrieve almost all the details from the file except when there is a list. <uniqueid type="tmdb">745272</uniqueid> <uniqueid type="imdb" default="true">tt13095604</uniqueid> How do I retreive the value for uniqueid>imdb I cannot find any assistance via google that explains this situation. Or am I missing something really simple I have attached the files The Phenomenon (2020).nfo is the XML file cm_movieinfo.dtd is the Document Schema cm_movieinfo.xdb is the generated Delphi Data Binding Unit. cm_movieinfo.dtd The Phenomenon (2020).nfo cm_movieinfo.xdb
  16. [See 2nd Post on Solution] I keep hitting this road-block. There no source code it's pointing to. It's just pointing to CPU assembly code. It's always the same segment fault. How do I trace it down? The segment fault happens when it gets around 33 or 34 files of ran*.txt. There's plenty of space left to create hundreds more files, but it likes to stop around 33 or 34 on the ran*.txt Tfile.copy? I added true to the end of it... but the overwrite parameter didn't help. Error: BFD: C:/Users/alt/Documents/Embarcadero/Studio/Projects/Filler/Android/Debug/FSP/debug/linker: don't know how to handle section `.relr.dyn' [0x 13] Process FSP.apk (4871) [Switching to Thread 5055] Process FSP.apk (4871) First chance exception at $BD9F069E. Exception class Segmentation fault (11). Process FSP.apk (4871) BD9F069E F8525023 ldr.w r5, [r2, r3, lsl #2] BD9F06A2 BF08 it eq BD9F06A4 2608 moveq r6, #8 BD9F06A6 4281 cmp r1, r0 BD9F06A8 EA460605 orr.w r6, r6, r5 BD9F06AC F8426023 str.w r6, [r2, r3, lsl #2] BD9F06B0 D1EE bne.n 0xbd9f0690 call stack thread --> :BD9F069E ??() :BD9A21A6 ??() :BD9A21A6 ??() it doesn't tell me where the error is... but I suspect it to be in this procedure because it's in the middle of creating the ran*.txt files: Global variables: var Form1: TForm1; FileDirectory, RandomFileToCopy: String; FilePermissions, DeleteFiles, DeleteInProgress: boolean; DeleteDirectoryList: TArray<system.string>; MaxFreeSpace: Int64; debugLines: TStrings; dButtonPreviousIsPressed: boolean; breakit: boolean; copydataActive: boolean; const FillerDiectoryNameConst = 'FILLER'; Procedure that I believe to be causing the segment fault: procedure TForm1.CopyData(); var DriveStr : String; FileNameCounter : integer; FolderCounter : integer; FolderName : string; FolderArea : string; RandomFileName : String; begin copydataActive := true; RandomFileToCopy := ''; FileNameCounter := 0; FolderCounter := 0; DriveStr := FileDirectory + TPath.DirectorySeparatorChar; RandomFileToCopy := DriveStr + 'random.txt'; // create random file //CreateNewRandFile(64000000); //64 mb file CreateNewRandFile(640); //640 file for testing purposes inc(FolderCounter); FolderName := 'rand' + IntToStr(FolderCounter); FolderArea := FileDirectory + TPath.DirectorySeparatorChar + FolderName; LabelLine2.Text := ''; while DirectoryExists(FolderArea) = true do begin inc(FolderCounter); FolderName := 'rand' + IntToStr(FolderCounter); FolderArea := FileDirectory + TPath.DirectorySeparatorChar + FolderName; LabelLine1.Text := 'Folder: ' + FolderName; if breakit = true then exit; end; try TDirectory.CreateDirectory(FolderArea); dString('CreateDirectory:'+FolderArea); except on E : Exception do begin dString('CreateDirectory(FolderArea):'+E.ClassName+' error: '+E.Message); copydataActive := false; exit; end; end; while CheckDiskSize(FolderArea) > 0 do begin if breakit = true then exit; RandomFileName := FolderArea + 'ran' + IntToStr(FileNameCounter) + '.txt'; FileNameCounter := 0; while FileNameCounter<126 do begin inc(FileNameCounter); RandomFileName := FolderArea + TPath.DirectorySeparatorChar + 'ran' + IntToStr(FileNameCounter) + '.txt'; try //if FileExists(RandomFileName) = true then DeleteFile(RandomFileName); LabelLine1.Text := 'Creating: ran' + IntToStr(FileNameCounter) + '.txt'; dString('Create RandomFile:'+RandomFileName); sleep(50); //dString writes to a file log file. TFile.Copy(RandomFileToCopy, RandomFileName, true); Except On E: Exception Do begin dString('TFile.Copy(RandomFileToCopy, RandomFileName):'+E.ClassName + ' ERROR: ' + E.Message); breakit := true; //break on error end; end; if breakit = true then exit; end; while DirectoryExists(FolderArea) = true do begin inc(FolderCounter); FolderName := 'rand' + IntToStr(FolderCounter); FolderArea := FileDirectory + TPath.DirectorySeparatorChar + FolderName; LabelLine1.Text := 'Folder: ' + FolderName; if breakit = true then exit; end; // all else fails... and it still is true... exit if DirectoryExists(FolderArea) = true then begin copydataActive := false; exit; end; try TDirectory.CreateDirectory(FolderArea); dString('CreateDirectory:'+FolderArea); except on E : Exception do begin dString('CreateDirectory(FolderArea):'+E.ClassName+' error: '+E.Message); copydataActive := false; exit; end; end; end; copydataActive := false; end;
  17. I have a Delphi 10.4.2 project that has issues when clicking the file [lighttheme.pas] in the Projects window on the right. It won't open the file. I loads information into the Object Inspector but the file doesn't create a tab at the top. This file does not an associated .DFM. Its a unit file that holds procedures. The only way i can get it to open where i can edit it is to close my project then choose File | Open...and open the file that way. I have also tried to remove it and re-add it to my project with no change. Something is stuck somewhere. Any ideas?
  18. I did discovered a bug i guess by accident. I wanted to expand my own .inc file to support FreePascal but compiler did not let me. {$IF Defined(FPC)} {$IF Declared(FPC_VERSION)} {$IF FPC_VERSION >= 3} // [Pascal Error] kz.inc(80): E2026 Constant expression expected {$DEFINE UNICODE} {$IFEND FPC_VERSION} {$IFEND FPC_VERSION} {$IFEND FPC} A fix was to do it like this, himitsu from german Delphi-Praxis came up with: {$IF Defined(FPC) and Declared(FPC_VERSION) and (FPC_VERSION >= 3)} {$DEFINE UniCode} { FreePascal UniCode support } {$IFEND} I did open a Report -> Conditional Compiling dont work as expect If you think i was wrong, please correct me.
  19. I have a type LabView created DLL that creates the following structure: typedef struct { int32_t dimSizes[2]; double elt[1]; } DoubleArrayBase; typedef DoubleArrayBase **DoubleArray; void __stdcall SimpleDoubleArray(int32_t Channels, int32_t Points, DoubleArray *DoubleArray); In Delphi have defined the structure as follows: type PDoubleArray = ^DoubleArray; DoubleArray = ^PDoubleArrayBase; PDoubleArrayBase = ^DoubleArrayBase; DoubleArrayBase = packed record dimSizes: array[0..1] of Int32; elt: array[0..0] of Double; end; var procedure SimpleDoubleArray(Channels, Points : Int32; TestDoubleArray: PDoubleArray);stdcall; external DLLDirectory; and call the function : procedure TForm8.btn1Click(Sender: TObject); var TestDoubleArray : DoubleArray; begin SimpleDoubleArray(5,5,@Testdoublearray); end; My question is that when i assign the DoubleArray as the output of a function, how do i read the information that is stored in the TestDoubleArray? In other words, how do i access the DoubleArrayBase record values of dimSizes and elt from the TestDoubleArray variable that i passed to the function? I am basically translating what is done in this post: https://lavag.org/topic/20486-lv-dll-creates-mysterious-doublearray-class/ to a Delphi equivalent.
  20. Nicolò Blunda

    Get copyright info from code in macOS

    Hello. With this code (working on macOS) I get application version info: VersionInfoString:= (TNSString.Wrap(CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle, kCFBundleVersionKey))).UTF8String; I want to retreive the copyright info too. In info.plist the copyright string is the NSHumanReadableCopyright key value. It is possible to adapt code above to get it?
  21. Habarisoft released new versions of its native STOMP client libraries for Delphi / Object Pascal for open source message brokers: * Habari Client for ActiveMQ 7.2 – tested with Apache ActiveMQ 5.16.5 and 5.17.1 * Habari Client for Artemis 7.2 – tested with Apache ActiveMQ Artemis 2.23.1 * Habari Client for OpenMQ 7.2 – tested with Eclipse OpenMQ 6.3.0 * Habari Client for RabbitMQ 7.2 – tested with RabbitMQ 3.9.22 and 3.10.7 Release notes Full release notes can be found at: https://www.habarisoft.com/release_notes.html Home page, demo download, full documentation: https://www.habarisoft.com/ About Habari STOMP Client libraries Habari STOMP Client libraries enable Object Pascal applications to take advantage of message broker / message queue technology - which is distributed, loosely coupled, reliable and asynchronous - to build integrated systems, using peer-to-peer and publish-subscribe communication models.
  22. Goal: I have configured my app to be opened by some links in iOS, like myapp://lala (using custom scheme), or https://myapp.com/c/lala using universal links, and is already opening my app, but i need to know which url that opened my app. (There is even a tutorial in FMX Express) Problem: I'm trying to handle incoming url from my ios app unsuccessfully. On iOS this should be done by capturing event TApplicationEvent.OpenURL like: procedure TipUrlHandler.ApplicationEventMessageHandler(const ASender: TObject; const AMessage: TMessage); begin case TApplicationEventData(TApplicationEventMessage(AMessage).Value).Event of TApplicationEvent.OpenUrl: HandleUrl(TiOSOpenApplicationContext(TApplicationEventData(TApplicationEventMessage(AMessage).Value).Context).URL); else end; end; Mas o TApplicationEvent.OpenUrl nunca é chamado. So I checked the class TApplicationDelegate in the unit FMX.Platform.iOS.pas in which the TApplicationDelegate.applicationOpenURLWithOptions function should be called every time the app is opened by a url as Apple documents: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application?language=objc class function TApplicationDelegate.applicationOpenURLWithOptions(self: id; _cmd: SEL; application: PUIApplication; url: Pointer; options: PNSDictionary): Boolean; So I went to check if the applicationOpenURLWithOptions method is being added correctly in TApplicationDelegate.CreateDelegateMetaClass: class procedure TApplicationDelegate.CreateDelegateMetaClass; begin ... // Opening a URL-Specified Resource if TOSVersion.Major >= 9 then class_addMethod(DelegateClass, sel_getUid('application:openURL:options:'), @applicationOpenURLWithOptions, 'B@:@@@@') else ... end; And then I was able to prove it wrong! The number of arguments declared is wrong, as the correct one should be B@:@@@ Then I made the modification to FMX.Platform.iOS.pas, being as follows: class procedure TApplicationDelegate.CreateDelegateMetaClass; begin ... // Opening a URL-Specified Resource if TOSVersion.Major >= 9 then class_addMethod(DelegateClass, sel_getUid('application:openURL:options:'), @applicationOpenURLWithOptions, 'B@:@@@') else ... end; But the TApplicationDelegate.applicationOpenURLWithOptions function is not yet called. What is wrong? @EDIT Sorry! It is working for custom schemes like "myapp://lala" (with or without the correction in FMX.Platform.iOS.pas) but it is not working for universal links like https://myapp.com/c/lalala. Although I have already configured the universal link correctly and when I click on this universal link, the iOS open my app, but the url can't be handle with TApplicationEvent.OpenUrl, but I discovered that the handling of incoming url of a universal link is different: Handling Universal Links
  23. I have a TEdgeBrowser log into a website that has PDF records we need to download to our system. When I enter the URL for the PDF, the PDF is loaded into the browser. How can I download the PDF instead of displaying it? Thanks, Sidney
  24. Clément

    Project manager feature

    Hi, I was wondering if there's a feature (or plugin) that would allow me to right click a folder and add a new unit direct in that folder. For example: When I right-click "task.code" folder, I would like the context menu to display two new options "add new unit" and "add new existing unit". When selecting "add new unit", "Unit1.pas" would be created under "task.code" allowing me to renaming that unit directly and start working on it. Do you know if there's such a tool? I'm using D11.1 TIA, Clément
  25. Hi all. To complete my first Python + DelphiVCL program I need to expose to Python an extra Image Viewer Control. I don't want to create a custom delphivcl.pyd which is a good thing remains original and installable with pip install delphivcl, so I've tried to add the component in a custom package. Well, seems simple to do but does not work fine... The control to expose is TImgView32 which inherits from: TImgView32->TCustomImgView32->TCustomImage32->TCustomPaintBox32->TCustomControl so it is close to TLabel and looking at DelphiVCL code I've made same steps: library cnc_vision_ext; uses osPyCncVisionExt in 'sources\osPyCncVisionExt.pas'; exports PyInit_cnc_vision_ext; {$E pyd} begin end. unit osPyCncVisionExt; interface uses PythonEngine; function PyInit_cnc_vision_ext: PPyObject; cdecl; implementation uses System.Classes, System.SysUtils, System.Variants, Winapi.Windows, Vcl.ExtCtrls, VarPyth, WrapDelphi, WrapVclExtCtrls, WrapVclControls, WrapDelphiClasses, GR32_Image; type TPyDelphiImgView32 = class(TPyDelphiControl) private function GetDelphiObject: TImgView32; procedure SetDelphiObject(const Value: TImgView32); public class function DelphiObjectClass: TClass; override; property DelphiObject: TImgView32 read GetDelphiObject write SetDelphiObject; end; TPyExtensionManager = class private FEngine: TPythonEngine; FModule: TPythonModule; FWrapper: TPyDelphiWrapper; public procedure WrapperInitializationEvent(Sender: TObject); end; var ExtensionManager: TPyExtensionManager; { module import functions } function PyInit_cnc_vision_ext: PPyObject; begin Result := nil; try ExtensionManager.FEngine := TPythonEngine.Create(nil); ExtensionManager.FEngine.AutoFinalize := False; ExtensionManager.FEngine.UseLastKnownVersion := True; ExtensionManager.FEngine.LoadDllInExtensionModule(); ExtensionManager.FModule := TPythonModule.Create(nil); ExtensionManager.FModule.Engine := ExtensionManager.FEngine; ExtensionManager.FModule.ModuleName := 'cnc_vision_ext'; ExtensionManager.FWrapper := TPyDelphiWrapper.Create(nil); ExtensionManager.FWrapper.Engine := ExtensionManager.FEngine; ExtensionManager.FWrapper.Module := ExtensionManager.FModule; ExtensionManager.FModule.Initialize; ExtensionManager.FWrapper.OnInitialization := ExtensionManager.WrapperInitializationEvent; ExtensionManager.FWrapper.Initialize; Result := ExtensionManager.FModule.Module; except end; end; { TPyDelphiImgView32 } class function TPyDelphiImgView32.DelphiObjectClass: TClass; begin Result := TImgView32; end; function TPyDelphiImgView32.GetDelphiObject: TImgView32; begin Result := TImgView32(inherited DelphiObject); end; procedure TPyDelphiImgView32.SetDelphiObject(const Value: TImgView32); begin inherited DelphiObject := Value; end; { TPyExtensionManager } procedure TPyExtensionManager.WrapperInitializationEvent(Sender: TObject); begin FWrapper.RegisterDelphiWrapper(TPyDelphiImgView32); end; initialization ExtensionManager := TPyExtensionManager.Create; finalization ExtensionManager.Free; end. Well, compilation OK and import on Python OK, but when I try to create the object assigning the parent I got that: from delphivcl import * from cnc_vision_ext import * class TestForm(Form): def __init__(self, owner): # print type of self ('__main__.TestForm') print(type(self)) # create a vcl label and assign parent: WORKS self.label = Label(self) self.label.Parent = self self.label.Left = 10 self.label.Top = 10 self.label.Caption = 'Hello World' # create a ext image and assign parent: ERROR self.image = ImgView32(self) # <-- AttributeError: Owner receives only Delphi objects self.image.Parent = self self.image.Left = 10 self.image.Top = 30 self.image.Width = 200 self.image.Height = 100 def main(): Application.Initialize() Application.Title = 'test' MainForm = TestForm(Application) MainForm.Show() FreeConsole() Application.Run() if __name__ == '__main__': main() ù If I check with a Python console the types seem very close: D:\x\develop\qem\cnc_vision_1>python Python 3.9.12 (tags/v3.9.12:b28265d, Mar 23 2022, 23:52:46) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from delphivcl import * >>> from cnc_vision_ext import * >>> frm = Form(None) >>> lbl = Label(frm) >>> lbl.Parent = frm >>> type(lbl) <class 'Label'> >>> lbl.__doc__ 'Wrapper for Delphi TLabel\n' >>> lbl.ClassName 'TLabel' >>> img = ImgView32(frm) # does not work with frm as like as lbl Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: Owner receives only Delphi objects >>> img = ImgView32(None) # try with none to check object type >>> type(img) <class 'ImgView32'> >>> img.__doc__ 'Wrapper for Delphi TImgView32\n' >>> img.ClassName 'TImgView32' Thank you in advance for any suggestion 🙂
×