Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. saeiddavoody

    Decrypt a string with public key

    Hi, In my VCL application I send a request to server and receive a data that encrypted by php openssl_private_encrypt. Now I want to decrypt it with public key. How should I do that? Is there a third-party component to do that? what difference between using openssl library to decrypt data with public key and decrypting it using other library or pure RSA?
  3. Today
  4. In a codegen project I am working on, I am importing an API and creating the Delphi code to utilize it. I prefer working with records so most of the codegen is creating record types for the request/response objects exposed by the API. However, about 5% or less of this large API types involve circular references between types. I tried a few different approaches and couldn't come up with a decent solution with records so I starting to use forward declaration with classes, at least for this 5%. That seems to work, but now I think I need to make all the types classes instead of having a mixture. I ventured into Variants and even implemented my own custom type via TInvokeableVariantType to get some properties defined but generic variant custom record types don't work. It was a cool side trek but didn't solve this problem. After stewing on this for a while, I thought I'd ask for any feedback. Would you prefer a large API with 95% simple records and some occasional class-based request/responses due to a funky API design, or would you want to see it consistent throughout and only use classes? Or would you implement an alternative approach? TRecordA = record Field1:Integer; Field2:TRecordB; Field3:string; TopX:TRecordC; end; TRecordB = record Field4:Integer; Field5:TRecordA; end; TRecordC = record Items:TArray<TRecordA>; end;
  5. You can't edit a post after some time has passed. And you can't delete a post, but you can flag a post and ask a moderator to delete it for you.
  6. Remy Lebeau

    Visible Application List

    What exactly have you tried that is not working for you? Please show some code. Which API are you using to enumerate running processes? CreateToolhelp32Snapshot(), EnumProcesses(), EnumWindows()? Have you tried APIs like GetModuleFileNameEx(), GetProcessImageFileName(), QueryFullProcessImageName()?
  7. Yesterday
  8. PeterBelow

    eztwain.obj для 64 bit

    You need a 64-bit obj file for that. Is this for a C++-Builder or a Delphi project?
  9. PeterBelow

    Can I make the form larger in the IDE?

    I you are running the IDE on a monitor with scaling set to anything other than 100% it matters if you have enabled high DPI support for the form designer or not (the latter is equivalent to launching the IDE via the Delphi (DPI unware) shortcut the installer provides in the start menu group. You can find the relevant setting in the Tools -> Options dialog:
  10. Mark Billig

    Visible Application List

    I am trying to create a list of applications that are running and visible, similar to Windows "Task Manager" in simple view. I have been successful except for applications that are running elevated. I am trying to get the "File Description" property and as long as I can get the file name and path I can get the description. Is there a way to get the file description directly or a way to get the name and path of an elevated application? I have been searching but everything I have come across so far does not work.
  11. I feel dumb, want edit first post, can't find how to want erase one post, seems impossible! 😕
  12. Thanks, Angus. Until I can get the new version working with C++ Builder (Been crushed at work and haven't had time to get at it), I have to use 8.x, where someone else might have this issue. Sorry, I should have mentioned that I had this issue with 8.x, not 9.x
  13. The form is rather small in the IDE making it hard to work with. Is there a way to adjust the size of the form in the IDE? Could I make it the same size as it is when the program is run? I am using version 11.2.
  14. Brandon Staggs

    Double, default value

    Yup, which is just one more reason why safety through automatic initialization is illusory.
  15. Stefan Glienke

    Double, default value

    Which - fun fact - does not happen on the method call (unless it's a virtual method) but when accessing any member inside of it. You could still have some method which does not access any member and it will not AV at all. We can argue all day about this - any runtime behavior one might slap onto it will not save the language from being inherently unsafe. It needs to be built into the language/compiler itself (Hi, Rust)
  16. MMSoft

    Request "Access All Files" Permission ?

    Thanks, it works ! (I had been looking for it for days).
  17. Dave Nottage

    Request "Access All Files" Permission ?

    With this: uses Androidapi.JNI.Os; LHasAccess := TJEnvironment.JavaClass.isExternalStorageManager; Note that this applies from Android 11 onwards only, so you should use TOSVersion.Check(11) to determine whether or not to manage that permission
  18. I'm using Delphi 12.1 and have the option to give my App the option to "Access all files". To do this, I check "Manage external storage" under Uses Permissions. I will display the System Setup screen in which this permission data can be data.: uses Androidapi.JNI.GraphicsContentViewText, Androidapi.JNI.Net; var LIntent: JIntent, LUri: Jnet_Uri; Begin LUri := TJnet_Uri.JavaClass.fromParts(StringToJString('package'), TAndroidHelper.Context.getPackageName, nil); LIntent := TJIntent.JavaClass.init(TJSettings.JavaClass.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, LUri); LIntent.addFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK); TAndroidHelper.Context.startActivity(LIntent); end; But how can I ask whether this Permission has been given ? (sorry for my bad english)
  19. But you can easily check for nil, while that's not possible for "uninitialized". And you can also easily spot them in the debugger. Also, referencing a non-initialized object reference does not necessarily result in an access violation, while referencing nil definitely does.
  20. Dave Nottage

    Android and services...

    As I mentioned in my first reply, you could use the code from TNotificationCenterAndroid.CreateNativeNotification as an example. Inside that is this: function GetDefaultIconID: Integer; begin Result := TAndroidHelper.GetResourceID('drawable/ic_notification'); if Result = 0 then Result := TAndroidHelper.Context.getApplicationInfo.icon; end;
  21. Henry Olive

    Delete First & Last Character

    Thank you so much Jon, Remy
  22. DelphiTheWorld

    Problem of click on a component

    Hi the forum, Thanks Patrick for your help and your answer. So finally, I have proceed like that : In the Frame constructor i remove all the objects names of the Frame I memorized the "ComponentIndex" of the object of the Frame I'm interested to interact When I need to use it, I'm casting by the class and use the good index! For example: TLabel(Components[IndexMemorized]).Text := 'MyText'; I'm joining you my final solution package. Again thanks a lot to everybody for your help. TestD3.zip
  23. That's an odd opinion, considering that a "pointer variable" or object reference with a nil value still results in an Access Violation if used before it is assigned a valid (allocated) memory reference. Using a local pointer variable before it is assigned a value is an error, regardless of whether the variable "defaulted to NIL". As Stefan stated, by not defaulting a value, the compile will give a warning (which I change to an error for every project). This code would not give a warning (silly example, but still): var MyForm: TForm := nil; MyForm.Show;
  24. Remy Lebeau

    Delete First & Last Character

    The SysUtils unit in Delphi's RTL has AnsiDequotedStr() and AnsiExtractQuotedStr() functions for that exact purpose.
  25. This is not correct. When P4D is used in an extension module it uses LoadDllInExtensionModule which just uses the dll loaded in the python process. It does not load or initialize the python dll. The calling process does that. So you can have more than one Delphi generated pyd files without issues.
  26. JonRobertson

    Delete First & Last Character

    There is a lot of information and documentation available about string handling in Delphi. Here are two quick references: http://www.delphibasics.co.uk/ByFunction.php?Main=Strings https://www.thoughtco.com/string-handling-routines-delphi-programming-4092534 And here is a very basic solution to your request. Your actual purpose may be different from your description, but this code does what you asked: var str := '''abc'''; WriteLn(str); if str[1] = '''' then Delete(str, 1, 1); var last := Length(str); if str[last] = '''' then Delete(str, last, 1); WriteLn(str); ReadLn;
  27. Good Day Str := 'Abc' or could be Abc First, I want check if first char = ' then i want to delete it Second I want check if Last char = ' then i also want to delete it that is, if Str='Abc' then the result should be Abc if Str = Abc then i dont need to do anything Thank You
  28. corneliusdavid

    New patch is coming ?

    Thanks for the correction; I missed the "and ..." part.
  1. Load more activity
×