Jump to content

Ian Branch

Members
  • Content Count

    1272
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Ian Branch

  1. Ian Branch

    Issue with UsesCleaner..

    Hi Team, I couldn't find where to report this to Uwe so here I am.. D10.4.1, Win 10, 32bit. I downloaded what I believe is the latest UsesCleaner.zip, built it and tried it on an App. It appeared to do the right thing producing this.. unit MainFrm; interface uses System.SysUtils, System.StrUtils, System.UITypes, System.TimeSpan, System.ImageList, vcl.wwdbgrid, vcl.Buttons, vcl.Grids, vcl.wwdbigrd, vcl.DBCtrls, vcl.ImgList, Windows, Messages, Variants, Classes, Graphics, Controls, Unfortunately, when I went to build my project I got this error.."[dcc32 Error] MainFrm.pas(326): E2010 Incompatible types: 'NativeUInt' and 'TSearchRec'" on this line.." FindClose(sr);" in this code.. procedure FillFiles(Strings: TStrings; const strDirectory: string); var sr: TSearchRec; begin if FindFirst(strDirectory + '\*.tbl', faAnyFile, sr) = 0 then try Strings.BeginUpdate; try Strings.Clear; repeat Strings.Add(sr.Name); until FindNext(sr) <> 0; finally Strings.EndUpdate; end; finally FindClose(sr); end; end; After some head scratching and trying various things I eventually changed the order of the uses clause to this... unit MainFrm; interface uses Windows, System.SysUtils, System.StrUtils, System.UITypes, System.TimeSpan, System.ImageList, vcl.wwdbgrid, vcl.Buttons, vcl.Grids, vcl.wwdbigrd, vcl.DBCtrls, vcl.ImgList, Messages, Variants, Classes, Graphics, Controls, Note the relocation of the Windows, The App now builds and runs fine. Is this a bug with UsesCleaner or Delphi?? Regards, Ian
  2. Ian Branch

    Issue with UsesCleaner..

    That will do it every time. ;-)
  3. Ian Branch

    Issue with UsesCleaner..

    Hi Uwe, I have a project Group with 18 projects, including DBiWorkflow. I ran UsesCleaner over the group. 1. Edited .cfg to make Compressed = 0 & GroupNames empty - No issues building or running the Apps. 2. Edited .cfg to make Compressed = 1 - No issues building or running the Apps. 3. Edited the GroupNames back in. - No issues building or running the Apps. Attached for your reference is the DBiWorkflow.dpr and the UsesCleaner.cfg from this exercise. Thank you. Regards, Ian UsesCleaner.cfg DBiWorkflow.dpr
  4. Ian Branch

    Issue with UsesCleaner..

    Sure. I suspect that is not all involved though. Here you go. DBiWorkflow.dpr
  5. Ian Branch

    Blob might have been initiated??

    Hi Team, I have similar code to below in several places // pBlob := dmC.jtImages.CreateBlobStream(dmC.jtImages.FieldByName('JTImage'), bmWrite); // try pBlob.Seek(0, soFromBeginning); // fsFile := TFileStream.Create(sFileName, fmOpenRead or fmShareDenyWrite); try pBlob.CopyFrom(fsFile, fsFile.Size); finally fsFile.Free end; finally pBlob.Free end; // end else begin MessageBeep(MB_ICONERROR); TaskMessageDlg('File not found!', 'File ' + sFileName + ' not found!', mtError, [mbOK], 0); pBlob.Free; end; pBlob is declared as a TStream. I consistently get the following error message.. "[dcc32 Warning] XXXXXFrm.pas(1213): W1036 Variable 'pBlob' might not have been initialized" pointing to the last pBlob.Free; I know it is only a Warning but it is annoying in an otherwise clean compile/build. What am I missing? How do I rectify this please? Regards & TIA, Ian
  6. Ian Branch

    Blob might have been initiated??

    Hi emailx45. Yes, I have those safeguards, including checking and limiting the image file type/size. Only .jpg or .jpeg & <256kB.
  7. Ian Branch

    Blob might have been initiated??

    Interesting. I retyped the line and it, Delphi, is happy now.
  8. Ian Branch

    Blob might have been initiated??

    Hi amailx45, Interesting. That would not have occurred to me in a million years. Slight problem.. Delphi doesn't like it. :-( SFileName is an undeclared identifier... Ian
  9. Ian Branch

    Blob might have been initiated??

    OK. My thanks to emailx45 for getting me on the right track & overcoming my laziness. 😉 My above code has been condensed to... // (dmC.jtImages.FieldByName('JTImage') as TBlobField).LoadFromFile(sFileName); // Thank you. Regards, Ian
  10. Ian Branch

    Blob might have been initiated??

    Actually I just discovered why I was getting the messages. I was doing a Free of pBlob at the end of the "if FielExists(sFileName) then ..." and of course nothing had happened with pBlob at that time. My Bad. Thanks for looking. Ian
  11. Ian Branch

    Blob might have been initiated??

    Hi emailx45, My apologies. I thought the code was fairly generic and therefore wouldn't need further clarification. My Bad. 😞 D10.4.1, ElevateDB. In this case jtImages is an ElevateDB Table Blob field. Yes, dmC is a datamodule. I am guilty of simple cut & paste when I incorporated my code. I note your alternative code. TBlobStream appears to be an element of the BDE, which I don't have installed. Ian
  12. Ian Branch

    Issue with UsesCleaner..

    HI Uwe, I hadn't, but now did. It still made the project unusable. Whilst there may be a convention about the structure of the Uses clauses, one-line per, I'm not fussed. ;-) When I loaded the Project, the 'ProjectGroup' had gone from attached screenshot_4 to screenshot_3. :-( Don't sweat it. It was just a thought bubble. Regards, Ian
  13. Ian Branch

    Issue with UsesCleaner..

    @Uwe Raabe What's the chances of UsesCleaner being able to process .dpr files?? Just a thought bubble... ;-) Ian
  14. Hi Team, I came across this by accident... http://www.delphiarea.com/products/delphi-packages/assistant It hasn't been touched in years. Does anybody know of something similar and more recently supported? I am using D10.4 att. Regards & TIA, Ian
  15. Ian Branch

    Office Assistant component..

    Agreed. Quite interesting. The consensus thus far for the 'tool' would seem to be it is more of academic value than production.
  16. Ian Branch

    Office Assistant component..

    Hi Anders, Thanks for the feedback. I can certainly see how it would be useful in some sort of training environment. ATT as I learn about it I have only implemented in its basic form as a novelty thing when closing the App. Applicability to other areas is still in question. IIUC it isn't going to work as is under Win 7 so that will be a road block. I had a look at DoubleAgent but it appears the animations are no longer available. Anyway, it is still a learning exercise for me, even if it isn't used in the end. Regards, Ian
  17. Ian Branch

    Office Assistant component..

    BTW, it doesn't have to be this 'Clippy' thing, it is the concept of some sort of animated prompt that interests me.
  18. Ian Branch

    Office Assistant component..

    Hi Anders & Remy, Thank you both for your responses. Very informative. I'm afraid things like TAgent, MSAgent ActiveX & MSAgent Server are not things I have any knowledge of. This 'Clippy' thing is something I am playing with att and if it is appropriate it will be on Win 7 PCs. Customer refuses to update. I see the note/reference about Double Agent. I will have a look. Are there any limitations/expectations to its use? I am hoping it will be OS/App agnostic, aside from being Windows based. Regards & Tks again. Ian
  19. Hi Team, I need to prevent Users from actually editing, including deleting, a TComboBoxEx whilst still allowing the contents to be changed via the drop-down. The component's OnChange event fires whenever they do something in the field. The component doesn't have a Read-Only property. This might get in the road of the drop-down working, so what do I do? Regards & TIA, Ian
  20. Ian Branch

    Prevent editing in a TComboBoxEx..

    No shame involved. I suspect ALL programmers are guilty of this more than once. ;-)
  21. Ian Branch

    Palette not showing anything..

    Just to close this off. I did a complete D10.4.1 De/Re. All good now.
  22. Hi Team, My D10.4.1 IDE continues to play up. :-( Now my editing toolbars have disappeared.. Where/how do I reenable them please? Regards & TIA, Ian
  23. Ian Branch

    Edit toolbars have dissappeared??

    Just to close this off. I did a complete D10.4.1 De/Re. All good now.
  24. Ian Branch

    Parnassus Bookmarks issue..

    Hi Team, D10.4.1, Win 10 64bit, Parnassus Bookmarks 1.6.2. After sorting out some other issues with the IDE I am now down to an error with rtl270.bpl when the IDE exits. I progressively disable the IDE Add-Ins without any change until I de-installed Parnassus Bookmarks, PB,via GetIt. The issue/error on exit disappeared. Reinstalling PB the problem returns. Investigating, I found that when PB is uninstalled it leaves ParnassusCoreEditor_XSydney.dll in C:\Program Files (x86)\Common Files\ParnassusShared. Ah Ha! Says I, delete it and do a fresh install of PB. Ummmm. No, Delphi hangs trying to load the Core Editor. Fortunately I had squirreled it away and restored it. Reinstalled PB, same issue on exit. 😞 I use PB all the time and really don't want to lose it but I don't want the error on exit either... Thoughts/suggestions, polite ;-), appreciated. Regards, Ian
×