Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/10/25 in Posts

  1. The error message indicates that the compiler is not evaluating the right-hand side expression as you expect. Instead of converting V to a string and concatenating the result to the string literal it is trying to convert the literal to a variant containing a TBcd, adding the two numbers, and then convert the result to a string. If you have a masochistic streak put a breakpoint on the statement, run to it, call up the disassembly view and F7 through the generated code (debug dcus need to be enabled). I would not call that a bug, just unexpected behaviour. But as you know, in programming the compiler is always right... 🙂
  2. Anders Melander

    Capture as soon as file paste is selected

    How exactly would GetClipboardOwner help here? Did you read the whole thread before posting?
  3. The problem is inconsistency, as it compiles when f is declared as a local variable. Also see the example in the comment of Jost Riedel in the mentioned QP issue. procedure X(i: Integer); begin end; procedure Y1; var f: TFunc<Integer>; begin X(f); // compiles end; procedure Y2; begin var f: TFunc<Integer>; X(f); // fails end;
  4. Wait. We DO want a compiler error here, right?? X takes an integer, not a TFunc<Integer>. It makes sense that this should need to be X( f() ).
  5. It does, but in this case, since the operation involves a native type (string) on the left and a custom user type (TBcd) on the right, the operation gives the custom type an opportunity to decide whether to cast the left side to the custom type, which it does in this situation, and then the failure occurs during that cast from string to TBcd.
  6. marcovaldo

    PascalAbc.Net

    Hi Delphi/Pascal Folks, Today I was searching the Net for Role of Linux, Pascal, Modula2, Oberon in Russia and China. Turned out that in Russia, Pascal is still used strong for Educational Purposes. (I think some time ago someone fom Embarcadero Sales told me that sales were strong in russia (probably before special military operation started and sanctions issued)) Among obviously old Turbo Pascal and Freepascal, there exists a DotNet IDE and Compiler https://PascalABC.net This relies on Dotnet/Mono and supports Windows/Linux/IoS Maybee this might be of interrest to at least to act as a debug shell for testing DotNet Dlls. Kind greetings, M.
  7. Anders Melander

    Capture as soon as file paste is selected

    I'm apparently not getting the message through; There is nothing special required, by neither the source nor the destination, in order to support copy/paste of files via RDP. The RDP support is transparent. If your remote application copies data onto the clipboard in the FileContents & FileGroupDescriptor formats, then the local destination will be able to paste it. Waitamoment.. I just realized that you just used remote desktop as an example. You will not actually be using remote desktop. Is that correct? So you are actually just asking how remote desktop makes the remote clipboard available to the client and how to replicate that functionality in your own client/server system. Well, I don't know the exact details of how it's done but I know enough about the clipboard and dragdrop that I can guess. On the server, the RDP host monitors the clipboard (there's an API for that). When data is copied onto the clipboard, in one of the formats supported by RDP, the server sends a message to the client with the meta data (data formats, size, etc.) of the clipboard data. On the client, the RDP client receives the message and copies the (meta) data onto the local clipboard using an IDataObject interface. On the client, some application pastes from the clipboard... The local clipboard asks the local data source, via the IDataObject interface, for the data. The local RDP receives the data request on its IDataObject interface and forwards this request to the remote RDP server. The remote RDP server in turn does the same: It asks the remote clipboard for the data, the remote clipboard asks the remote data source (whoever copied the data onto the clipboard in the first place), etc. Once the remote RDP server has the data it sends it back to the local RDP client which then supplies it, through the IDataObject, to the local application. Done. Paste complete. A normal paste can cause data to be sent back, through IDataObject, notifying the source about the paste. I don't know if RDP propagates this information all the way back to the server.
  8. Seems that this issue was resolved with this patch: https://blogs.embarcadero.com/rad-studio-12-3-april-patch-available/ SInce yesterday it was available on Getit and now also in the EMB portal.
  9. Or you could use a wrapper (as demonstrated for TNotifyEvent in https://stackoverflow.com/questions/11491593/tproctobject-to-tnotifyevent): MyTableTest.BeforeDelete := AnonProcToDataSetNotifyEvent(MyTableTest, procedure (D: TDataSet) begin LogTableOperation('MyTableTestBeforeDelete'); end);
  10. You can't just convert it, but you can make same behaviour type TDataSetAnonimouseEvent = reference to procedure(DataSet: TDataSet); TForm3 = class(TForm) FDQuery1: TFDQuery; bntAddNewEvent: TButton; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure bntAddNewEventClick(Sender: TObject); private { Private declarations } FEventLinks : TDictionary<TComponent, TDataSetAnonimouseEvent>; public { Public declarations } procedure AllTablesBeforeDelete(DataSet: TDataSet); end; var Form3: TForm3; implementation {$R *.dfm} procedure TForm3.AllTablesBeforeDelete(DataSet: TDataSet); begin //check if we have anonymous event for this component if FEventLinks.ContainsKey(DataSet) then begin //call anonymous event FEventLinks[DataSet](DataSet); end; end; procedure TForm3.bntAddNewEventClick(Sender: TObject); begin //link anonymous event to specific component FEventLinks.Add(FDQuery1, procedure(DataSet: TDataSet) begin ShowMessage('Anonimouse event!'); end ); end; procedure TForm3.FormCreate(Sender: TObject); begin FEventLinks := TDictionary<TComponent, TDataSetAnonimouseEvent>.Create; FDQuery1.BeforeDelete := AllTablesBeforeDelete; end; procedure TForm3.FormDestroy(Sender: TObject); begin FreeAndNil(FEventLinks); end;
  11. This is documented behavior: https://docwiki.embarcadero.com/RADStudio/en/Anonymous_Methods_in_Delphi
  12. Show off 😉 Thanks, I have added it to the bug report.
  13. I'm still kind of new to using generics but I try to start using them where previously I would have created a pseudo template. I need to store some objects and access them giving a string key. I thought that a TObjectDictionary<string, TMyClass> would be the solution for this, but it turns out that it does not allow duplicates, but I need that. Later on I want to get the first matching entry and enumerate all of them. What would be the best generic container for allowing duplicates in this case, if there is any? Some kind of sorted object list? (I'm asking for generics that are part of the RTL, please don't point me to any 3rd party implementations.)
  14. If you don't expect to have many duplicates then a dictionary with TArray for values is more time and memory efficient. I am using such a structure in SynEdit: SynEdit/Source/SynEditMiscClasses.pas at master · pyscripter/SynEdit.
  15. Bogo

    TRibbon issue on delphi 12

    Good morning, I'm migrating from Delphi 10.3 to Delphi 12, but I'm facing the following issue: Using the native TRibbon component in Delphi, I dynamically create its menus according to a TMainMenu and a TActionManager. Up to this point, no issues; it's creating normally as it always has. However, when I use the TRibbon property "Use Custom Frame" as True, so that the ribbon's frame becomes the main one on the screen, the following error occurs: When minimizing or switching the program to another screen, my menus, which were displaying correctly before, are now showing this "black image. Anyone know how to solve this?
  16. Rick Malik

    Capture as soon as file paste is selected

    Isn't there a GetClipboardOwner(void) function you could hook, in there someplace?
×