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

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

  1. specs: window 7 64bit, delphi 11.2, phone s10+ with android 12 I've been wanting to ask this question for some time and an opportunity came to me and I'm now asking... I would like to send text from my galaxy s10+ phone to my laptop over wifi, and back, from my laptop to Android over wifi. I want to type some text, a word, or a whole paragraph, and send it. Are there any demos or how-tos for this? I searched my sample folders but did not find anything. Also, I do not want to use a USB cable, nor do I want to join/use any outside services from other sources. I don't want to download any apps, register, and all that. I want this to be strictly private and only from my two devices. TIA
  2. program Project2; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Math; begin var a,b:double; a:=1.015; b:=2.275; writeln(round(a*Power(10,2))); writeln(round(b*Power(10,2))); readln; end. Please run as 32 and 64bit I split this off to its own topic, so that future readers will find this tightly packaged. Please consider creating a new thread for any question/issue/remark that is not exactly the same as the opening post of a thread - Sherlock
  3. I have an e-scooter that I use for riding around towns and trails. There is an app to download. However, that app does not connect to my scooter and the developer is slow to fix/resolve/respond and still does not connect. So, I would like to look into writing my own app for my phone (android) to do the following: 1. track start and end times 3. track my routes - where i've been or stopped at 4. show the miles I am traveling during my ride in real-time 5. show the total miles of my ride 6. possibly show speed (via calculation) and in real-time 7. eventually, to show a map of my route in real-time, and show all my stops Is this possible with Delphi 11.2 and free components/services/API's ?
  4. robertjohns

    Wow64EnableWow64FsRedirection

    Hello I am trying to check file existence in both directories c:\windows\system32 and c:\windows\syswow64 I tried to use Wow64EnableWow64FsRedirection true and false method, when I do not use Wow64EnableWow64FsRedirection method I get c:\windows\syswow64 but when I use Wow64EnableWow64FsRedirection(False); I get c:\windows\system32 but issue is when I use Wow64EnableWow64FsRedirection(True); I do not get c:\windows\syswow64 I am actually trying On Disable, c:\windows\system32 On Enable, c:\windows\syswow64
  5. Hi all, I'm looking to find a decent, easy-to-use Profiler to help identify performance bottlenecks and memory leaks. I'm a small-project user so not looking to pay too much - free and open source options are welcome as long as they're straightforward to use - no command line stuff, please. It's 2023 and I'm using RAD Studio 10.4.2 - I believe SmartBear used to provide a standard version of AQTime with an earlier version of RAD, shame they stopped doing this really because now it seems we have to pay big bucks for this particular profiling system. Recommendations and suggestions welcome, thank you!
  6. robertjohns

    Cecking Application Execution

    Is there any possibility to check if the exe is executed by clicking on its own icon or by external exe Suppose Exe-1 and Exe-2 Need to check Exe-1 is whether executed by clicking on its own icon or executed by external Exe-2
  7. I have created library for Delphi-Console-Applications Supports Windows 11 (and earlier from XE5?) Replaces CRT Unit - crt.pas Can be used to write modern and appealing console applications. Should allow older (legacy) source code (Borland Pascal 7.0) to run under Windows. Unicode-Support (including e.g. chinese characters) many more features - see GitHub https://github.com/playcom-de/Console I hope this is helpful for someone. Question, suggestions and error reports are welcome.
  8. Hi, Here is a problem. I would like to run an application with normal user privileges from elevated process. My installer (elevated process) is written in Delphi. It launches some programs at the end of installation. Now, as Installer is elevated, lauched process is also elevated - we don't want this! The goal is to launch non-elevated process from elevated installer process. So: - Launch any application with normal user privileges - Launch default web browser with given webpage - Send email to given person (with protocol Sendto:) As far as I know it can be done using Windows Explorer process. I couldn't find any Delphi code for that in Internet 😞 I only found C- based. Here is one that suppose to work: https://www.appsloveworld.com/coding/delphi/48/createprocess-with-lower-privileges-than-the-caller Could you please try to convert it into Delphi? I tried, but without success (see below example). There are some problems with pointers (I tried to do pointers typecasting - it compiled, but with access violation)... For example: FindDesktopFolderView(IID_IShellView, spsv); --> FindDesktopFolderView(IID_IShellView, Pointer(spsv)); I am sure, this is not a way I should do. Here is my code in simple project. Source: https://www.dropbox.com/s/6ndno59brgbn6l0/ExecAsUser.zip?dl=1 Thanks in advance, -Pawel
  9. i have this code here: fTask: ITask; fTask := TTask.Create( procedure begin while not True do Application.ProcessMessages; TThread.Synchronize(TThread.Current, procedure begin // update ui end); end); fTask.ExecuteWork; // this will stop here.. until [fTask] finish work !! In android didn't wait untill Task Complete !!
  10. I'm trying to follow Dave Millington's code rage example from 2016 on how to use a Delphi abstract class to make an abstract class for use in a C++ Builder bpl library where you need to link to a lib file that is only available in C. https://learndelphi.org/this-is-how-to-use-c-builder-to-extend-the-reach-of-delphi/ https://github.com/Embarcadero/CodeRage2016 I made a function called about in my concrete class called TBridge::About derived for a pure abstract delphi class which I can call sucessfully. However when I do so Application->MessageBox falls over as it doesn't seem able to create a font resource or lacks resources. I am assuming in am not linking some sort of necessary resource file into my C++ BPL ? The question is I don't know which files I should be linking into the BPL to get it to display standard VCL dialogs. MessageDlg doesn't work either. //--------------------------------------------------------------------------- #pragma hdrstop #include "SolidBridge.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #include <windows.h> #include <vcl.h> #include <Vcl.Controls.hpp> #include <Vcl.stdCtrls.hpp> #include <Vcl.Forms.hpp> #include <Dialogs.hpp> #include <Vcl.Dialogs.hpp> void __fastcall TBridge::About() { //Application->MessageBox('Hello world!','About',MB_OK); UnicodeString txt = "Hello world"; Application->MessageBox(L"Hello world",L"About", MB_OKCANCEL); //MessageDlg(txt,mtInformation,TMsgDlgButtons() << mbOK,0); } TAbstractBridge* __stdcall SolidBridgeFactory() { return (TAbstractBridge*)new TBridge(); } ResData is passed in a zero so the first line ResHash := VCL.Graphics.GetHashCode(ResData, ResDataSize); throws an exception in VCL.Graphics {$IF NOT DEFINED(CLR)} function TResourceManager.AllocResource(const ResData): PResource; var ResHash: Word; LOwner: TThreadID; begin ResHash := Vcl.Graphics.GetHashCode(ResData, ResDataSize); Lock; try LOwner := TThread.CurrentThread.ThreadID; Result := ResList; while (Result <> nil) and ((Result^.Owner <> LOwner) or (Result^.HashCode <> ResHash) or not CompareMem(@Result^.Data, @ResData, ResDataSize)) do Result := Result^.Next; if Result = nil then begin GetMem(Result, ResDataSize + ResInfoSize); with Result^ do begin Next := ResList; RefCount := 0; Handle := TResData(ResData).Handle; HashCode := ResHash; Owner := LOwner; Move(ResData, Data, ResDataSize); end; ResList := Result; end; Inc(Result^.RefCount); finally Unlock; end; end; {$ENDIF}
  11. I have a unit which tries to use the TListView in Virtual mode, by setting OwnerData to true. Theroretically all this should simply work, as long as I monitor the OnData, OnSelectItem, OnDataStateChange and possibly OnChange. But what happens, it that all 'OnSelect's are reported by Windows, but NOT all 'unSelect's. As a result, my VirtualItemList end up with more and more Selected Items, while in reality, there is (for example) only 1 Selected Item in the ListView. Below is an (Log) example of what happens: = I click on item 0: OnSelectItem: Item not assigned! OnChange: Index=0 Virtual Count=3001 Item=Caption 0 Selected=TRUE OnSelectItem: Item=Caption 0 Item.Selected=TRUE Selected=TRUE = I now shift-click on Item3, to multi-select all 4 Items: VirtualItemList.OnSelectItem: Item not assigned! *** OnDataStateChange: Start=0 End=3 *** OnDataStateChange: 0 Item: Caption 0 Selected=TRUE *** OnDataStateChange: 1 Item: Caption 1 Selected=TRUE *** OnDataStateChange: Changing VirtualItem Caption 1 to TRUE *** OnDataStateChange: 2 Item: Caption 2 Selected=TRUE *** OnDataStateChange: Changing VirtualItem Caption 2 to TRUE *** OnDataStateChange: 3 Item: Caption 3 Selected=TRUE *** OnDataStateChange: Changing VirtualItem Caption 3 to TRUE OnChange: Index=0 Virtual Count=3001 Item=Caption 0 Selected=TRUE OnChange: Index=3 Virtual Count=3001 Item=Caption 3 Selected=TRUE MouseUp: Base Selcount=4 Virtual=4 REAL=4 NOTE: - OnSelectItem is NOT called during 'Shift-Click' for the Selected items. - I now must use OnDataStateChange to Select these. - OnChange is ONLY called for Index 0 and 3. Not for the ones in between. = I now click on Item 4. (This should UN-select all other Items. It does do so on the screen...) OnSelectItem: Item not assigned! OnChange: Index=3 Virtual Count=3001 Item=Caption 3 Selected=FALSE *** OnChange: Caption 3 has changed to: FALSE OnChange: Index=4 Virtual Count=3001 Item=Caption 4 Selected=TRUE *** OnChange: Caption 4 has changed to: TRUE OnSelectItem: Item=Caption 4 Item.Selected=TRUE Selected=TRUE MouseUp: Base Selcount=1 Virtual=1 REAL=4 NOTE: - The OnChange only reported UNSelect for Item 3, and the Select for Item 4, but there is no event anywhere for Item 0, 1 and 3. - I now have FOUR Selected items in my Virtual List (The SelCount is hard overwritten from the ListView Selcount) - OnDataStateChange is NEVER called to report all the UN-Selects. The entire Test program source code can be downloaded here (200k): https://sartrack.nz/temp/VirtualListViewTest.zip I really wonder if it possible at all to do this, as this seems to be a Windows issue. Using Windows 10, Delphi 11.
  12. Hello, I'm trying to create a combobox that I can style to look like this. I'd **LIKE** to do it solely in the WYSIWYG style designer. Can anyone point me to a tutorial on how even to change the font size in the Style designer? I'm admittedly such a noob in this, but I'm at a total loss. Thanks. - Mike
  13. robertjohns

    Find String in TstringList

    I am trying to find find Strings in TstringList I used almost all method but nothing working In StringList I have some some.pds other other.cff -- I am trying to find some.pds ad other.cff .. Result is True but If in Stringlist some other -- and still I am trying to find some.pds ad other.cff .. but still Result is True whereas it should return false How can I find Specific string in Tstringlist
  14. robertjohns

    Form Creation

    I am creating a Form1 and freeing it after some time Now I am trying to check if Form1 is created then create Form2 If Assigned(Form1) then Application.CreateForm(TForm2, Form2); But It does not seems to work any suggestion
  15. I need to run a small program in the Windows Preinstallation Environment, my program works fine on v7 & v10, but crashes on v8.1. Windows 8.1 ISO: https://www.microsoft.com/en-us/software-download/windows8 On the Windows Installer window, I press Shift+F10 to open CMD, then I run the program from there. Here is the example code, I'm using Delphi 11.3 CE: program Project3; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; begin WriteLn('Test'); ReadLn; end. Here is the result if SysUtils is included: Here is the result if SysUtils is not included, so I suspect the problem comes from the SysUtils unit. I'm new to Delphi recently and don't have the ability to debug in this case. Please help, thanks for everything.
  16. VishalTanwar

    Delphi Debugging Help

    Hi All, I am new to learn Delphi technology. I am using Delphi 7 application. Can anyone help me regarding learning part. from where I need to start and what things i need to see. I got the basic details from the internet but still I am struggling for debugging part. If anyone can help, please let me know. Thank You
  17. EDIT: Apologies for the rant-like nature of this post, but... I'm getting frustrated with Delphi programming. Rather than toss my laptop out the window, I'd rather express my frustration here on the Forums and hopefully it comes to something a bit more productive than a broken laptop and a feeling of regret. ----- Why can I sometimes access properties, functions, variables etc from other units, and sometimes not? "Private" and "public" doesn't seem to make any difference, either. Sometimes I'll start to type the name of a class, followed by "." and a list of all the available items comes up. I assure you, sometimes even when I make something "public", it still won't appear in that list. Why??? Also, the practice of creating "instances" of classes within procedures is ridiclously cumbersome and unintuitive. If I've created a property/variable/field/whatever in Class1.pas, it should be accessible from Class2.pas without me having to create a "version" of Class1 first. If it's declared in uses, that should be that! Forgive me for the rant, but aren't we as programmers supposed to be in charge of the program, not the other way around?!
  18. robertjohns

    File Search

    I am using Delphi 10.2 Is it possible to search Directories and Sub-Directories by File Name instead File Mask like mytext.txt instead of *.txt So far I tried the following function but it does not work by filename it works with file extension another issue with this function is that it does not list the complete searched files from Windows\system32\drivers\ procedure FindFilePattern(root:String;pattern:String); var SR:TSearchRec; begin root:=IncludeTrailingPathDelimiter(root); if FindFirst(root+'*',faAnyFile,SR) = 0 then begin repeat Application.ProcessMessages; if ((SR.Attr and faDirectory) = SR.Attr ) and (pos('.',SR.Name)=0) then FindFilePattern(root+SR.Name,pattern) else begin if pos(pattern,SR.Name)>0 then Form1.ListBox1.Items.Add(Root+SR.Name); end; until FindNext(SR)<>0; end; end; procedure TForm1.Button1Click(Sender: TObject); begin FindFilePattern('C:\','.sys'); end;
  19. Qasim Shahzad

    Why Should a C-Sharper Learn Delphi?

    I plan to create some introductory videos for my DelphiTube channel on this topic: Delphi for C-Sharpers The question is, why should a C-Sharper (C# user) learn Delphi? I am definitely biased toward Delphi, but is it really beneficial for a C-Sharp user? My thoughts are: Learning another language is a good option. Delphi can create standalone executable that do not need third-party frameworks. You can build cross-platform native applications with Delphi. It would be an easy move if you joined through the C++ Builder path. Delphi is highly productive. What's your point of view? Can you add some reasons? Please guide. Thank you so much for your attention and participation.
  20. Dear all, I have install the Delphi 11.3 CE and try to compile the project to iOS64 target and received this exception [Fatal Error] Module not found: dcciosarm64280.dll I have tried to reinstall the Delphi on two different PCs but nothing changed. Any idea where the problem is ? Thank you Regards Jan
  21. Ali Dehban

    ChatGPT plug-in for RAD Studio.

    Hello, everybuddy. Recently I made a plug-in for Delphi to use ChatGPT inside the IDE. The main service is ChatGPT but it's actually multi-AI support, you can get responses from three different sources, compare and decide. I hope this can be helpful and accelerate your work. Repository: https://github.com/AliDehbansiahkarbon/ChatGPTWizard Key features: - Free text question form. - Dockable question form. - Inline questions(in the editor). - Context menu options to help you to find bugs, write tests, optimize code, add comments, etc... - Class view. - Predefined Questions for class view. - History to save your tokens on OpenAI ! - Fuzzy string match searches in the history. - Animated letters(Like the website). - Proxy server options. - Supports Writesonic AI (https://writesonic.com) - Support YouChat (https://you.com) Short Video 1: Short Video 2 - Inline Questions: Full Video (ver. 2.0):
  22. Dumpfbacke

    Unigui and TShape

    Hello everyone here. I have a VCL program which I would now like to convert to UniGui. It's an easy part here, at least I thought so in the beginning. There is a TImage in which I want to draw a rectangle, which is transparent as a TShape. I do my program like this Shape is a TShape; OnMouseDown Shape.Left := X; Shape.Top := Y; Shape.Width := 0; Shape.Height := 0; OnMouseMove Shape.Width := X - Shape.Left; Shape.Height := Y - Shape.Top; OnMouseUP Shape.Width := X - Shape.Left; Shape.Height := Y - Shape.Top; repaint; At the end I would also like to have the coordinates of the shape. There is no onMouseMove in TUniImage, but that wouldn't be so bad because the rectangle is mainly drawn at the end. Can someone help me here? Is there an alternative to TShape for UniGui? Thanks in advance for your help. Tanja
  23. If you want to specify "i" as being any value between 0 - 7, you can use for i := 0 to 7 do And, as I understand it, this will run code as long as "i" matches any value between 0 and 7. But, what if you only want to run the code when "i" matches every value between 0 and 7 at the same time? So, for example, rather than typing: if (X, Y - 0) and (X, Y - 1) and (X, Y - 2) and (X, Y - 3) etc... Is there a way to express it as (X, Y - i) where i can be any value between 0 and 7, but every value must be accounted for simultaneously?
  24. The app I'm working on has different "screens", which are each essentially large bitmaps. When closing a screen to go to the next one, the following code provides a fade-to-black transition effect: procedure TGameBaseScreen.FadeOut; var Steps: Cardinal; i: Integer; P: PColor32; StartTickCount: Cardinal; IterationDiff: Integer; RGBDiff: Integer; const TOTAL_STEPS = 32; STEP_DELAY = 12; begin Steps := 0; StartTickCount := GetTickCount; while Steps < TOTAL_STEPS do begin IterationDiff := ((GetTickCount - StartTickCount) div STEP_DELAY) - Steps; if IterationDiff = 0 then Continue; RGBDiff := IterationDiff * 8; with ScreenImg.Bitmap do begin P := PixelPtr[0, 0]; for i := 0 to Width * Height - 1 do begin with TColor32Entry(P^) do begin if R > RGBDiff then Dec(R, RGBDiff) else R := 0; if G > RGBDiff then Dec(G, RGBDiff) else G := 0; if B > RGBDiff then Dec(B, RGBDiff) else B := 0; end; Inc(P); end; end; Inc(Steps, IterationDiff); ScreenImg.Bitmap.Changed; Changed; Update; end; end; Is there any way this same code can be modified to create a new FadeIn; procedure which allows the screen images to fade-in-from-black? I'm guessing I need to first specify that RGB := 0, 0, 0 and then increase the RGB values until they reach the actual bitmap values. Do I first need to "get" those values somehow? Or, is there a better way to achieve the Fade In/Out procedures? (note that we're dealing with combined bitmaps here, rather than single images)
  25. I have a form with a treeview, which can be browsed using the arrow keys. Once an item in the treeview is selected, hitting an "OK" button on the form (which has the modal result mrOK) will close the form, and load the currently selected item into the app. What I want to do is assign VK_RETURN (which I believe is the [Enter] key...?) to the OK button, so that when browsing the treeview using keys, the user can just hit Enter/Return to load the currently selected item. btnOKClick has its own procedure, detailed here: procedure TFLevelSelect.btnOKClick(Sender: TObject); begin WriteToParams; ModalResult := mrOk; end; I can enter "WriteToParams;" into the Treeview's OnKeyDown procedure, but this doesn't actually have any effect until the OK button is pressed. So, one option is to tell the OnKeyDown procedure to also "virtually press the OK button" (which I'm not sure is even possible...?) - this would be my preferred method, if it can be done. Another option is to assign a hotkey to btnOKClick. The only problem with this is that there are multiple other buttons on the form, all of which already respond to [Enter] when Tab-selected. If I assign [Enter] as a hotkey to btnOKClick, then [Enter] either can't then be used for any of the other buttons on the form - or, worse, the app will crash because it won't know which button to press if the Tab is on a different button than 'OK', and the user hits [Enter]. Any and all suggestions/help welcome. I apologise if I haven't provided any necessary information.
×