Jump to content

david_navigator

Members
  • Content Count

    144
  • Joined

  • Last visited

Everything posted by david_navigator

  1. david_navigator

    FMX in VCL app - working natively ?

    The project file has no mention of FMX in it at all. This is just a host VCL form in a VCL app where I mistyped a unit name i.e MyFormU rather then MyFormVCL_U and then instantiated the form thus MyForm := TmyForm.Create(...); MyForm.Showmodal; It was only after running that I realised that the TmyForm being instantiated was the one from the FMX unit rather than the VCL one. (If you're wondering why I have two similar units one VCL and one FMX, I'm in the process of converting a third party FMX project to VCL)
  2. david_navigator

    About UniGUI Layout

    Have you asked in the UniGUI forums ? That's where the experts hang out.
  3. The delphi RESTDebugger has an option "Copy Components", that puts something like this on the clipboard. object RESTClient1: TRESTClient BaseURL = 'https://api-eu1.XXXXXXXXXXXXXXX/ORD' Params = <> end object RESTRequest1: TRESTRequest AssignedValues = [rvConnectTimeout, rvReadTimeout] Client = RESTClient1 Method = rmPOST Params = < item Kind = pkHTTPHEADER Name = 'x-api-compleat-key' Value = '0aXXXXXXXXXXXXXXXXXXXXXX94' end item Kind = pkREQUESTBODY Name = 'body9BE6CF603159471FB026D7FF6FC3D2DB' Value = '{"master_id":1,"LayoutID":"d967cc4c-5b2b-4474-8cac-a71f9684ee70"' + ',"TransactionStatus":"SAV","Reference":1,"PoNumber":"ORD1","Date' + 'Created":"2008-07-08","SupplierName":"TMB","CurrencyCode":"GBP",' + '"SupplierID":"1234","LineItems":[{"master_id":1,"Description":"G' + 'obo Original","UnitCost":"100.00","Net":"100.00","Quantity":1,"T' + 'ax":0,"Gross":100},{"master_id":1,"Description":"Gobo Copy","Uni' + 'tCost":"50.00","Net":"100.00","Quantity":2,"Tax":0,"Gross":100}]' + '}' ContentType = ctAPPLICATION_JSON end> Response = RESTResponse1 end object RESTResponse1: TRESTResponse end I can take this and paste it on to a form and Delphi will create all the components etc. However I don't want to paste it in to a form at design time, I want to store it and then use the data to create a populated form at run time. I haven't got a problem reading and writing this to an external storage format nor creating the form at run time, but how to I then use this to create the components ? Google suggest using TReader, but unless I'm looking at the wrong example, that only seem to handle one component, not a whole load that reference each other. Does any one have any code to help or can tell me what key words I need to be searching for ? Many thanks
  4. david_navigator

    Stream in controls at run time created by REST Debugger

    @Uwe Raabe Many thanks. That's really helpful. I owe you a beer or two 🙂
  5. david_navigator

    Stream in controls at run time created by REST Debugger

    Yup, That seems to do what IO want, well it certainly gives me enough information to be able to do what I want. Thanks for your help too though.
  6. david_navigator

    Stream in controls at run time created by REST Debugger

    Many Thanks. That's exactly what I was after.
  7. david_navigator

    Stream in controls at run time created by REST Debugger

    Because I have to start at run time with what the RestDebugger produces. Imagine the end user presses Copy Components in the Rest Debugger, then goes to my app and clicks "Paste Components" - I need the mechanism that effectively goes from object RESTClient1: TRESTClient BaseURL = 'https://api-eu1.XXXXXXXXXXXXXXX/ORD' Params = <> end to RESTClient1 := TRESTClient.Create(Self); RESTClient1.BaseURL := 'https://api-eu1.XXXXXXXXXXXXXXX/ORD';
  8. david_navigator

    Stream in controls at run time created by REST Debugger

    Thanks but maybe I didn't explain properly. I know how to create components etc at run time and I use the Gexpert tool frequently, but in this particular scenario I need to go from the code created by the RestDebugger to a working set of components, BUT all done at run time. So effectively I need to do what delphi does when you click Paste on a delphi form and it streams in the code from my OP.
  9. david_navigator

    Encryption - are multiple keys possible ?

    Hi I don't really know much about encryption and have been tasked with designing a system where the customer has the following requirements and I've no idea if it's possible and if it is possible, what terms I should be using to search Google for more info. Simplifying as much as possible, basically the customer wants to store his driving license info and his passport info in an encrypted file. He then wants to be able to give Tom, Dick and Harry, a key each, such that Tom can only decrypt the driving license, Dick can only decrypt the passport but Harry's key can decrypt either. Is this possible (In reality there are 1000's of documents and 100's of keys required) ? (My guess is that I probably need to encrypt each document with different keys and then encrypt the appropriate set of public keys for each of Tom, Dick & Harry ?) Many thanks David
  10. david_navigator

    Encryption - are multiple keys possible ?

    I don't want anyone other than Tom, Dick & Harry to be able to access the data. So a DBA shouldn't be able to run a query and see the unencrypted data, however I've just noticed a more fundamental flaw in what the customer is proposing, so I need to address that first.
  11. david_navigator

    Encryption - are multiple keys possible ?

    Thanks. The above sounds the way ahead. Homographic encryption certainly doesn't sound my thing !!!
  12. david_navigator

    Encryption - are multiple keys possible ?

    They will be in a database but the database I'm using doesn't offer record level access rights (do any ?) It is important that the actual data is encrypted as it must be impossible for the stolen table to be easily read, moreover if the database was stolen by Tom he shouldn't be able to decrypt Dick & Harry's data.
  13. david_navigator

    Delphi 64 bit Registration Tools for Windows Apps

    We use (and have used for over 20 years) CopyMinder from Microcosm. This supports 64 bit delphi apps. https://www.microcosm.com/software-protection/copyminder
  14. david_navigator

    Test Insight not drawing correctly

    Test Insight has stopped drawing correctly and I don't know where to look to find the problem (tried restarting PC etc). You can see that the tests are running and any errors are displayed, but the details of the test are missing. Additionally the "form" thinks that the display area is very wide (notice the bottom scrollbar) - first screenshot with scroll bar to the left & second to the right. I've also tried the form undocked Help !!
  15. david_navigator

    Test Insight not drawing correctly

    Wonderful. (Easy when you know how 🙂 All Now Working. Many thanks.
  16. david_navigator

    Test Insight not drawing correctly

    Version 1.2.0.0. of TestInsight - which is the latest I can find. DunitX installed from Gettit last night, so I assume it's the latest version. (DunitX a reinstall as the update to D10.4.2 seemed to remove it) Everything seems to be working from a testing POV - the tests run and report errors correctly and the footer of TestInsight displays what has happened correctly, it's just the tree view of tests that seems to be missing. It's definitely a drawing issue as if I move my mouse over where the tree view nodes should be drawn then I get the correct popup hint, furthermore double clicking where a node should have been drawn changes the popup hints (and the the right click context menu) in the correct way.
  17. david_navigator

    SQL expression evaluation not supported

    Do you need to cast the results to be the same type of the field ?
  18. david_navigator

    Delphi compatibility with Windows 11?

    What happens when your PC dies and you try and move your HDD to another machine - will it be usable ?
  19. david_navigator

    Abandoned components?

    We replaced it in one of our apps with TMS TPlanner. No idea how it compares to the other alternatives mentioned.
  20. david_navigator

    Program using FDTable that works on my computer, but not on others... (Database)

    Does the info here help at all ? https://stackoverflow.com/questions/26244425/general-error-unable-to-open-registry-key-temporary-volatile-from-access
  21. david_navigator

    Range check error.

    This com port routine has started to throw a range check error for one customer, at line ReadFile(ComHandle, Str[1], Count, BytesRead, @Overlapped); It's old code which has worked for years, but I'm guessing something in D10.4.2 is doing something differently as this customer is testing a 10.4.2 compiled version. Are there any gotcha's screaming out - I have a feeling that it's probably something to do with the Str[1] parameter, but I'm not sure. function Tcomportserver.ReadString(var Str : AnsiString; Count : Integer) : Integer; var Overlapped : TOverlapped; BytesRead : DWORD; begin SetLength(Str, Count); FillChar(Overlapped, SizeOf(Overlapped), 0); Overlapped.hEvent := CreateEvent(nil, True, True, nil); ReadFile(ComHandle, Str[1], Count, BytesRead, @Overlapped); WaitForSingleObject(Overlapped.hEvent, INFINITE); if not GetOverlappedResult(ComHandle, Overlapped, BytesRead, False) then raise EWriteError.Create('Unable to write to port: ' + LastErr); CloseHandle(Overlapped.hEvent); SetLength(Str, BytesRead); Result := BytesRead; end; Many thanks
  22. david_navigator

    Range check error.

    @Kas Ob. Thanks. I think that makes sense. The code that calculates Count is function Tcomportserver.InQue : Integer; var Errors : DWORD; ComStat : TComStat; begin if not FConnected then begin Result := 0; end else begin if not ClearCommError(ComHandle, Errors, @ComStat) then raise EComStatus.Create('Unable to read com status: ' + LastErr); Result := ComStat.cbInQue; end; end; so I think what you're saying is that at the time InQue runs (count) there might be 100 bytes waiting to be read, but by the time ReadString gets called, that might be 150 bytes ? It's probably never risen it's head as a problem because this code is simply processing short barcodes, so it's 10 bytes, then a pause whilst the human does something and then another 10 bytes etc, I'll refactor it though and check that it still works as the user expects.
  23. david_navigator

    Range check error.

    I've no idea. It's one of those units found on the internet many years ago and seems to have been working fine up until now.
  24. david_navigator

    Range check error.

    @Remy Lebeau Thanks for that - seems to address quite a few issues the original developer overlooked. I noticed that in the original code the developer was using WaitForSingleObject(Overlapped.hEvent, INFINITE); if not GetOverlappedResult(ComHandle, Overlapped, BytesRead, False) then Whereas in your version you are using if not GetOverlappedResult(ComHandle, Overlapped, BytesRead, True) then Do these do the same thing ?
×