Jump to content

david_navigator

Members
  • Content Count

    115
  • Joined

  • Last visited

Community Reputation

9 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. david_navigator

    TaskMessageDlg('.... behind form?

    I had a similar problem recently and it turned out to be due to a third party control on another form within my project. The 3rd party control did something in it's constructor that resulted in not only message dialogs opening behind, but popups, such as calendars doing similar - it of course didn't happen in normal use, but just when I happened to have two unrelated 3rd party controls in my app. (Thinfinity & TMS Planner)
  2. david_navigator

    Help debugging TNotificationCenter

    Problem solved. If the SendMessage originates from a different thread to that Presenting the Notification, then Windows raises the error "An outgoing call cannot be made since the application is dispatching an input synchronous call." As this is raised in the constructor of TNotificationWinRT, the destructor is called. The destructure doesn't check if FToast is assigned (which it's not 'cos the constructor fails) and thus raises an Access violation. I'll report this via QC. Meanwhile the fix to the original problem seems to be as simple as introducing a timer (which I'm guessing moves the processing to the main thread - is there a better way to do this ?). So the code becomes something like this (from my test app) procedure TForm62.comportclient1Receive(Sender: TObject; InQue: Integer); begin SendMessage(handle, pm_ProcessBarcodeScan, WPARAM(0), LPARAM(0)); application.processmessages; end; procedure TForm62.ProcessBarcodeScan(var Message: TMessage); begin inherited; SendWin10Notification('Hello World', 'Sent by Message'); end; procedure TForm62.SendWin10Notification(aTitle, aAlertBody: string); begin FNotification.Name := format('Windows10Notification%d', [GetTickcount]); FNotification.Title := aTitle; FNotification.AlertBody := aAlertBody; if not insendmessage then NotificationCenter1.PresentNotification(FNotification) else Timer1.enabled := true; end; procedure TForm62.Timer1Timer(Sender: TObject); begin if not insendmessage then begin NotificationCenter1.PresentNotification(FNotification); timer1.enabled := false; end; end;
  3. david_navigator

    Help debugging TNotificationCenter

    I think it must be something like that. Interestingly if I change the code so that rather than a local variable (which might go out of scope ?) the Notification is a class field, I get an additional error "An outgoing call cannot be made since the application is dispatching an input-synchronous call", then I get an AV !!
  4. david_navigator

    Help debugging TNotificationCenter

    Yes, Debug DCU's is checked. I can step through a lot of the source, until I get to Result := TToastNotificationManager.Statics.GetTemplateContent(LTemplateType); where the debugged just goes in to some interface assembler and no further. In this case, it's part of the design so that serial port data gets dealt with in the background whilst a dialog is visible if ScansDismissPromptsCheckbox.Checked then PostMessage(handle, pm_ProcessBarcodeScan, WPARAM(lKeyCode), LPARAM(Ord(TRUE))) // see bug tracker 3503 , need to be a PostMessage else begin SendMessage(handle, pm_ProcessBarcodeScan, WPARAM(lKeyCode), LPARAM(Ord(TRUE))); // see bug tracker 3009 , need to be a SendMessage application.ProcessMessages; end;
  5. david_navigator

    Help debugging TNotificationCenter

    I am getting an Access Violation in the VCL TNotificationCenter, however how it occurs is strange and I can't seem to debug far enough in to the delphi source to work out why. I have a delphi form with an editbox. The edit box has an OnKeyDown event. Within that OnKeyDown event we call a routine to check if the key was VK_RETURN and if it was, we then process the content of the edit box (Method ProcessBarcodeScan) and in certain circumstances we create a Windows 10 (Toast) notification. (The notification makes no reference to the edit box or any of it's properties.) Now, the odd bit, if I type in to the edit box, then everything works as it should and there are no errors and the "toast" pops up. If I populate the Edit box via a SendMessage thus SendMessage(BarcodeEdit.Handle, WM_CHAR, lKeyCode, 0); and then call the ProcessBarcodeScan method via a PostMessage, thus PostMessage(handle, pm_ProcessBarcodeScan, WPARAM(lKeyCode), LPARAM(Ord(TRUE))) again all works correctly. However, if I populate the edit box via the SendMessage as above and then call ProcessBarcodeScan via a SendMessage thus SendMessage(handle, pm_ProcessBarcodeScan, WPARAM(lKeyCode), LPARAM(Ord(TRUE))); application.ProcessMessages; I get an Access violation, which stepping through the code gets me to class function TToastTemplateGenerator.GetXMLDoc(const ANotification: TNotification): Xml_Dom_IXmlDocument; ... ... Result := TToastNotificationManager.Statics.GetTemplateContent(LTemplateType); but the only place I can find GetTemplateContent is in Winapi.UI.Notifications class function TToastNotificationManager which won't accept a break point This is my Notification code procedure TDMNexusConnect.SendWin10Notification(aTitle, aAlertBody: string); var lNotification: TNotification; begin lNotification := NotificationCenter.CreateNotification; try lNotification.Name := format('Windows10Notification%d', [GetTickcount]); lNotification.Title := aTitle; lNotification.AlertBody := aAlertBody; NotificationCenter.PresentNotification(lNotification); finally lNotification.Free; end; end; and this is the Access Violation. exception class : EAccessViolation exception message : Access violation at address 03C4EBE9 in module 'HireTrackNX.exe'. Read of address 00000000. thread $2c24: 03c4ebe9 +015 HireTrackNX.exe System.Win.Notification TNotificationWinRT.Destroy 77e64ee1 +021 ntdll.dll KiUserExceptionDispatcher 00407984 +004 HireTrackNX.exe System 34 +0 @FreeMem 0040cc24 +01c HireTrackNX.exe System 34 +0 @UStrClr 03c4eaa6 +046 HireTrackNX.exe System.Win.Notification TNotificationWinRT.Create 03c4deb3 +02f HireTrackNX.exe System.Win.Notification TNotificationCenterWinRT.DoPresentNotification 03c59b40 +018 HireTrackNX.exe System.Notification TCustomNotificationCenter.DoPresentNotification 03c59c52 +002 HireTrackNX.exe System.Notification TCustomNotificationCenter.PresentNotification 03de9d23 +0a7 HireTrackNX.exe DMNexus 2440 +7 TDMNexusConnect.SendWin10Notification
  6. david_navigator

    Routine to check if set of dates match

    1. My UI, so I "know" when a user changes a date. 2. I need to know if any lists are the same as my list. 3. answered by 2 - I don't want to know anything if they're different. 4. No. Imagine each list represents a hotel room and each element of the list is the check in and check out time for each visitor over the next 6 months - I need to know if any two rooms have exactly the same booking schedules. The dates change frequently, the comparison gets run infrequently, but the compare has to be very fast and the date changes can be slow.
  7. david_navigator

    Routine to check if set of dates match

    The date lists are sorted. There can be N date lists, I need to know which date lists match the current one.
  8. david_navigator

    Routine to check if set of dates match

    Thanks, for the idea, though I don't it won't work in this particular case as there are actually many lists and I need to know if any list matches my "current" list.
  9. I have a two sets of datetimes which I need to frequently check to see if the two lists are identical. There isn't the time to iterate through the lists whenever I need this info, so I'm thinking I need to store a value that represents the data. I think it's a hash, but this isn't something I've done before and everything I've attempted hasn't worked i.e I've changed some of the datetimes and ended up with the same result. If it's relevant there are usually about 60 in each set, but it could be between two and a thousand (always an even number) and each is only stored to the minute i.e seconds & mS are always zero. Can anyone point me in the correct direction please ? Many thanks David
  10. david_navigator

    Looking for Spreadsheet component

    Luckily I already have the DexEx & TMS controls mentioned in this thread and I have the budget for others if something suitable raised its head 🙂
  11. david_navigator

    Looking for Spreadsheet component

    Just my UI. The customer currently uses Google sheets as the UI and then copies data in to various other apps etc. They're after a similar UI, but with everything else automated. I've looked at various UI ideas and I too have come to the conclusion that for this particular task the excel feel is the best for the job. The solution doesn't need to be able to export in to excel or google sheets format and must be completely self contained i.e not just an automation of excel or sheets.
  12. david_navigator

    Looking for Spreadsheet component

    I did look at it, but it seemed very basic in comparison to the devEx one. Does it have in built support for all the usual excel functions such as inserting/deleting cells/rows/columns and all the other cells moving appropriately ?
  13. david_navigator

    Looking for Spreadsheet component

    Hi Has anyone come across a grid/spreadsheet component that will allow the developer to "attach" an Object to a cell (or even something as mundane as a tag), but has all the inbuilt functionality of basic excel such as inserting/deleting cells/rows/columns and allowing a range of cells to be selected and cut/copy and pasted elsewhere, grouping rows and allowing them to be expanded/collaspsed etc ? The Devex Spreadsheet does everything except for allowing any data to be attached to a cell 😞
  14. Initial tests show that changing the method thus SSLOptions.Method := sslvTLSv1_2; fixes the problem. Will do some more testing but looking good 🙂 Will try later versions of the dll's too.
×