Jump to content

All Activity

This stream auto-updates     

  1. Yesterday
  2. This is an old thread. However I have a question regarding Russell Libby's unit. Has anybody used/tested TPipeConsole? TPipeConsole uses standard pipes (OpenStdPipes calls CreatePipe), but then uses PeekNamedPipe on theses pipes in ProcessPipe. According to the documentation this is a blocking operation when used with anonymous pipes and the whole thing falls apart. Question: is this the case - does PeekNamedPipe blocks with anonymous pipes or this is only an issue when multiple threads try to access the same pipe? See also https://devblogs.microsoft.com/oldnewthing/20110707-00/?p=10223 by Raymond Chen
  3. Vincent Parrett

    Tools API - Changing Key Assignment

    I do this to remap IDE Insight (Ctrl + .) since I use Ctrl+. for the procedure list (old habit from coderush days) - however the IDE has a habit of resetting it while I'm working so I find myself having remap it again several times a day. I thought about writing a plugin to just fire a timer to periodically check if it had reset and then change it again 😉
  4. Mahdi Safsafi

    IOTAProcess.ReadProcessMemory / .WriteProcessMemory

    @Kas Ob. Yes that's what I meant. Good remark ! I made a test that asked for 100 byte and as you told exactly it reads 1024 bytes ! Asked for 4096 bytes and it reads 4096 bytes ... so I guess its doing that to cache the data because some IOTAProcess.ReadProcessMemory calls for small amount didn't pass all the time throw WinApi.ReadProcessMemory (fetched from the cache). The weird thing for me is the crashing you got.
  5. Dave Nottage

    The android app doesn't start at specific devices

    I've tried your app on my Samsung tablet which has Android 9, and the results are the same. It works on my Pixel 3a which has Android 11. Some questions: Was the application created in an earlier version of Delphi? i.e. like Delphi 10.3.x, or earlier? Does the Libraries node under the Android platform in Project Manager look different to this?: Are there any Java classes that your app uses that you needed to create (or find) an import for? i.e. one that was not supplied with Delphi? If so, which one(s)?
  6. Carlos Tré

    Tools API - Changing Key Assignment

    Thank you very much for your answer. I already had an expert in place to change the editor's toggle insert / overwrite mode for I am a lousy typist and was going crazy hitting the insert key when home was intended. As for a hammer everything looks like a nail, I thought that was the way to go. This is what I did: procedure TMelhoriasEditor.ReassignFormatSource; var LNTAServices : INTAServices; LActionList : TContainedActionList ; LAction : TContainedAction ; LActionName : string; begin Assert(Assigned(BorlandIDEServices)); LNTAServices := BorlandIDEServices as INTAServices; Assert(Assigned(LNTAServices)); LActionList := LNTAServices.ActionList; Assert(Assigned(LActionList)); for LAction in LActionList do begin LActionName := LAction.Name; if LActionName.Equals('actFormatSource') then begin LAction.Shortcut := (vkF or scCtrl or scShift or scAlt); Exit; end; end; end; It changed the main menu entry shortcut to the intended Ctrl+Shift+Alt+F key combination, but ir doesn't fire the action. Also, as noted, the local menu entry still shows associated with Ctrl+D and would fire it in case I remove its association with "MatarTecla", a do-nothing method. This leaves wondering if there's a way to get the TKeyBindingProc value other than the way (IOTAKeyboardServices.LookupKeyBinding) I tried. Or if I just didn't figured out the way to work it properly. Unfortunately this seems to be way above my league. Again, than you all for your precious time helping me. -- Best, Carlos
  7. Kryvich

    My custom component becomes NI>

    Where do you store reference variables for the tables? I.e. table1, table2 etc.
  8. Renate Schaaf

    Browsing for certain files on Android

    Please excuse my lack of knowledge here, I'm just starting to work with this Android stuff. I guess so. Well, I think I know how to do this, but that wouldn't help the user to pick to right video file, I need the thumbnails. By browers I mean that every app that processes the file type gets displayed at the top of the window that opens. For example Google fotos, Samsung gallery, ... I just want to open the documents folder ("Eigene Dateien" in my German tablet).
  9. Mahdi Safsafi

    Filter Exceptions expert and IOS / Android apps

    @Roland Skinner Thanks a lot man ! That's a great news knowing that it works mostly on all architectures. Just wondering what was wrong with Android 64-bit. Possibly from Delphi ... @Kas Ob have reported similar thing.
  10. Dave Nottage

    Browsing for certain files on Android

    By "browsers" I assume you mean "folders"? What does "MyDocuments" actually represent? Does it mean the files contained in the folder returned by TPath.GetDocumentsPath? If so, is there some reason why you cannot iterate the files in that folder, and just present them in a list box?
  11. It is internal, means not the OS API, as shown here there is six calls up to the OS call But one can only assume it does have the same parameters, because they have the same count and the same order, I just tested it, but the strange thing is, i issued read for 100 bytes the monitor shows the actual API read 1024 byte instead and return 100 byte as result, after than my XE5 just keep crashing !
  12. Mahdi Safsafi

    IOTAProcess.ReadProcessMemory / .WriteProcessMemory

    No ! I'm 100% sure that the internal function returns HRESULT and IOTAProcess.ReadProcessMemory returns bytes count.
  13. Cristian Peța

    My custom component becomes NI>

    You told as that a component is becoming nil. Nil can be a reference to an instance of a class (namely a variable), not a class itself. If table1 is that component that is becoming nil then put a data breakpoint on table1. More exactly on table1's address (namely @table1). But it is enough to write table1 into the addresses field of "Add Data Breakpoint" dialog. @Remy Lebeau thank you very match for this. I needed a data breakpoint sometimes but I didn't know they actually exists.
  14. David Heffernan

    IOTAProcess.ReadProcessMemory / .WriteProcessMemory

    Seems unlikely. The winapi functions return a BOOL and call SetLastError. HRESULT seems very implausible.
  15. That parameter is what I was referring to.
  16. Roland Skinner

    Filter Exceptions expert and IOS / Android apps

    Hi. No problem assisting. I've been using GExperts for probably 20 years; glad I can help out. This is Linux, with GExperts uninstalled: "Error Message": Division by Zero: Accessing Nil-pointer (calling ClassName on TObject variable): Now with GExperts installed and exception-expert enabled: Division by Zero: Accessing Nil-pointer: Then, in iOS (GExperts installed and expert enabled): Division by Zero: Accessing Nil-pointer: I'll report the errors with the message to Embarcadero. I actually came here looking about issues I have with the Linux debugger, to see if anyone else had experienced the problems I've noticed. I'll report these too. (For example, objects are displayed as pointer-addresses only, yet you can see their member-values in a popup-inspector.)
  17. Renate Schaaf

    Browsing for certain files on Android

    All I want is a substitute for an OpenFileDialog on Android, I mean, that can't be so hard, I thought. In particular I want the user to pick a video file and read its file name. I found this https://delphi-developers-archive.blogspot.com/2017/05/delphi-android-get-file-path-of-image.html and modified it a bit, so it either returns a valid file name or else fails: procedure TForm1.BrowseForVideoFile; var Data: Jnet_Uri; Intent: JIntent; begin // fMessageSubscriptionID: integer is a field of TForm1 FMessageSubscriptionID := TMessageManager.DefaultManager.SubscribeToMessage (TMessageResultNotification, HandleActivityMessage); Intent := TJIntent.Create; Intent.setType(StringToJString('video/*')); Intent.setAction(TJIntent.JavaClass.ACTION_GET_CONTENT); MainActivity.startActivityForResult(Intent, 0); end; // when message is received procedure TForm1.HandleActivityMessage(const Sender: TObject; const M: TMessage); begin if M is TMessageResultNotification then if HandleIntentAction(TMessageReceivedNotification(M).Value) then begin // A valid filename has been returned // Do The Videofile processing end; Edit2.text := fVideoFilename; end; // This retrieves the file name the user picked, but reliably only if done per // opening MyDocuments function TForm1.HandleIntentAction(const Data: JIntent): Boolean; var P: TJavaObjectArray<Jstring>; // in case you want only specific fields... not used here. I have passed nil to get all the columns. C: JCursor; I: integer; begin P := nil; // The following makes no difference // P:=TJavaObjectArray<Jstring>.create(1); // P.Items[0]:=StringToJstring('_data'); // this is suppose to give the information back to C ( : JCursor) C := MainActivity.getContentResolver.query(Data.getData, nil, // when projection is nil... it returns all columns. Ideally, you should only ask for the columns you need StringToJString(''), // java accepts nil... but you cannot give nil here, you need to give an empty JString nil, StringToJString('')); // java accepts nil... but you cannot give nil here, you need to give an empty JString C.moveToFirst; Result := false; for I := 0 to C.getColumnCount - 1 do begin if JStringToString(C.getColumnName(I)) = '_data' then // '_data' column contains the path... you can use this to create the filestream to upload or do whatever.... begin // fVideoFilename is a field of the form fVideoFilename := JStringToString(C.getString(I)); Result := true; Break; end; end; if not Result then fVideoFilename := ''; // P.Free; end; My problem is, that this offers way too many browsers for the user to choose from, when all that really works is browsing MyDocuments. What is the right approach to limit the browsers to MyDocuments? Or is there an easier way to begin with? Thanks for reading, Renate
  18. Hi My project's requirement is that I need to connect to any wifi network automatically from the phone app when the user selects the ssid from a list (with accompanying password if any). I came across this discussion on stackoverflow. I am no java expert so i wonder if anybody can help to get this working in Delphi ? Thank you very much
  19. clubreseau

    Need help with IDhttp and Thread

    Thank You Kryvich everything are perfect. The windows not feezing anymore, and the loop are going fast. Thank you for your time !
  20. Just a remark: I saw the reverse picture when my Win32 application in the Windows XP VirtualBox was running one and a half times faster than in the Windows 10 host machine...
  21. Kryvich

    My custom component becomes NI>

    Have you set the overflow and range checking in the project options?
  22. Kryvich

    Need help with IDhttp and Thread

    Yes, it's possible. And just in case an user needs to stop the download, I added the corresponding button. Now there are 3 states: dsIdle, dsExecuted and dsStopped. Downloader.zip
  23. alogrep

    My custom component becomes NI>

    Thanks Remy. The tables are created, populated and freed dynamically. Te component class is Tslim. Then according to what I need I do table1:=Tslim.Create; table2:=Tslim.create etc. Is it possible to put a databreakpoint on a class as opposed to a variable? How?
  24. David Hoyle

    Tools API - Changing Key Assignment

    Ctrl+D has never worked for me but then again I'm still using WordStar/Classic IDE key bindings which might grab Ctrl+D for moving the cursor.
  25. Thank you for your replies. @dummzeuch I use RDP to access these servers. Both apps are VCL apps. They don't use FMX. I used spy++ to confirm. JRM uses devexpress components. Anyway, I am going to create a simple VCL app that opens a dialog to see if it is affected. I contacted the vendors. In the TDM case they don't know, and as for JRM, I didn't get an answer yet. It is pretty hard - unless you have the hardware, and you are in control of everything, it's impossible to reproduce the issue. To me this whole thing looks like CPU starvation or CPU throttling that somehow affects these apps more than others. Unfortunately I don't have the knowledge to figure out what the heck is going on and how all these pieces (virtualization, vcl) affect each other. I was hoping that someone came across this before.
  26. Mahdi Safsafi

    IOTAProcess.ReadProcessMemory / .WriteProcessMemory

    HRESULT. In fact ReadProcessMemory calls an internal function that returns a HRESULT and then checks the value and returns the bytes count. # ReadProcessMemory: # ... 203BF56E | 8B45 E8 | mov eax,dword ptr ss:[ebp-18] 203BF571 | 50 | push eax 203BF572 | 8B00 | mov eax,dword ptr ds:[eax] 203BF574 | FF50 40 | call dword ptr ds:[eax+40] # InternalReadProcessMemoryFunction that reads the bytes and returns a HRESULT 203BF577 | E8 7096FAFF | call <dbkdebugide260.@Dbkhelper@CheckRetVal$qqrxl> # check HRESULT # ... 203BF599 | 8B45 FC | mov eax,dword ptr ss:[ebp-4] # result = bytes count
  1. Load more activity
×