Jump to content

alogrep

Members
  • Content Count

    200
  • Joined

  • Last visited

Posts posted by alogrep


  1. HI

    I hope someone can shed some light. I can mke it to work

    I have this code (pseudo)

    FUNCTION DOTHERPORT;
    BEGIN
    {$ifDEF  BO}
              result :=DoCharges(true,-1,false,False,false,lg('CLOSE CHARGES'),'1',dm2.sysdate.fieldbyname('date').asdatetime)
    {$else}

             result := DoCharges(sender=Nil,-1,False,False,FALSE,lg(TDsFancyButton(Sender).Caption),'',0,dm2.sysdate.fieldbyname('date').asdatetime);
    {$endif}
    END;

    function selectreport(sender: Tobject);
    begin
      if sender = good1 then
    {$DEFINE BO}
       dotherport;
       
    end;

    FUNCTION DOTHERPORT;
    BEGIN
    {$ifDEF  BO}
              result :=DoCharges(true,-1,false,False,false,lg('CLOSE CHARGES'),'1',dm2.sysdate.fieldbyname('date').asdatetime)
    {$else}
    
             result := DoCharges(sender=Nil,-1,False,False,FALSE,lg(TDsFancyButton(Sender).Caption),'',0,dm2.sysdate.fieldbyname('date').asdatetime);
    {$endif}
    END;
    
    function selectreport(sender: Tobject);
    begin
      if sender = good1 then
    {$DEFINE BO}
      else
    {$define OLD}
       dotherport;
       
    end;

    I would expect that the line under {$ifdef BO

      would execute. 

    Instead it goes to the other line.

    How does $DEFINE work?

    Thanks.


  2. The IDE keeps freezeng. The event viewer show this erros (repeatedly)

    Faulting application name: DelphiLSP.exe, version: 29.0.55362.2017, time stamp: 0x67bf9abb
    Faulting module name: dcc32290.dll, version: 29.0.55362.2017, time stamp: 0x00000000
    Exception code: 0xc0000005
    Fault offset: 0x00163819
    Faulting process id: 0x2638
    Faulting application start time: 0x01dbf12428349f04
    Faulting application path: C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\DelphiLSP.exe
    Faulting module path: C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\dcc32290.dll
    Report Id: c7279363-c4a3-4237-9b9b-6af86a9eca33
    Faulting package full name: 
    Faulting package-relative application ID: 

    I am going razy. What can be done to eliminate this error? Submitting reports is of no help, they never answer them.


  3. HI.

    I have this problem that is becomeming more and more frequent.

    I got to the point that on each second compile (or building, makes no diferene) it happens.

    If I exit the IDE immediately I am able do deletee the appliation.exe and restart the IDE.

    But if i invoke the taskmanager the system freezes and my only option is the shutdown button

    It is a nightmare.

    Anybody has any suggestion?


  4. Thanks both. But it still does not work. This is the code.

    I crated a unit

    unit myhint;

    interface
       uses classes, messages,graphics,controls, comctrls;
    type
      TMyHintWindow = class(THintWindow)
      protected
        procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN;
      public
        constructor Create(AOwner: TComponent); override;
      end;
    implementation
    constructor TMyHintWindow.Create(AOwner: TComponent);
    begin
      inherited Create(AOwner);
      Color := clinfobk;
    end;


    procedure TMyHintWindow.WMLButtonDown(var Message: TWMLButtonDown);
    begin
      // Close the hint window when clicked
      ReleaseHandle;
    end;

    end.

    unit myhint;
    
    interface
       uses classes, messages,graphics,controls, comctrls;
    type
      TMyHintWindow = class(THintWindow)
      protected
        procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN;
      public
        constructor Create(AOwner: TComponent); override;
      end;
    implementation
    constructor TMyHintWindow.Create(AOwner: TComponent);
    begin
      inherited Create(AOwner);
      Color := clinfobk;
    end;
    
    
    procedure TMyHintWindow.WMLButtonDown(var Message: TWMLButtonDown);
    begin
      // Close the hint window when clicked
      ReleaseHandle;
    end;
    
    end.

    in the dr:

     

        Application.Initialize;
        HintWindowClass:=TMyHintWindow;

    Then in the form  i include myhint.pas. In the FormCreate I crete the control

         wh:=TMyhintWindow.crete(nil)

    The wh constructor is executed (the beakpoint is triggered).

    But when I clkic on the hintt, the 

     

    procedure TMyHintWindow.WMLButtonDown(var Message: TWMLButtonDown);
    begin
      // Close the hint window when clicked
      ReleaseHandle;
    end;

     

    is not triggered.


  5. Hi

    I got this neat piece of code froma OpenAI GPT searc

    
     
    type
      TMyHintWindow = class(THintWindow)
      protected
        procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN;
      end;
    
    procedure TMyHintWindow.WMLButtonDown(var Message: TWMLButtonDown);
    begin
      // Close the hint window when clicked
      ReleaseHandle;
    end;

    I put the first part in the interface section, the second in the implementation.

    But the the WMLButtonDown   (clic left button, right?) never gets triggered.

    What is missing to make it work?

    Also, in case I make it work, I lso have set the timerr to hide it after 2 seconds. In the timere I use wh (The TMyHintWindow control)

    if wh <> Nil then begin   

      wh.releasehandle.

      wh.free;

      wh:=Nil;

    end.

    How can I make the same inside  the WMLButtonDown event?

    Thanks very much.

     

      wh

     


  6. OK maybe it wasn't clear.

    The grid is not shown in the code because is unrelated to that peace of code;

    A more completa  chunk of code:

    procedure printorder(grid: Tstringgrid);
    begin
    linesdone:='';       // SO FAR IT IS OK, STILL '0'
       prnums:=Tstringlist.create;
       with dm2  do  begin
          stationprinters.indexname:='number';
          stationprinters.setrange([_mycompname,1],[_mycompname,123]) ;
          stationprinters.first;
          while not stationprinters.eof  do begin
            prnums.add(stationprinters.fieldbyname('printernumber').asstring);
            stationprinters.next;
          end;
          stationprinters.cancelrange;
        end;
    chekqtys; // this is a procedure;
    .....
    ....
    compactgrid()

    And inside checkqtys() I manipulate the grid.

     I do not know why but the problem seems to have disappeared. Just as I do not know why it appeared.

    Maybe b/c deep inside checkqtys() I had a line where I set the cells[13,row to '1'. (but on certain conditions)

    But why WAY BEFORE it reached that point the value of the grid was changed?

     

     

     


  7. HI.

    I have lost 21 hours on this,.

     

    I have a stringrid that I need to make a function work correcly. 

    I store a value of Zero in all cells[13,row].

    I pass the grid to another function, and right at the beginning of this function misteriousely that value is changed to '1';

    This is the code

     

    begin
    linesdone:='';       // SO FAR IT IS OK, STILL '0'
       prnums:=Tstringlist.create;
       with dm2  do  begin
          stationprinters.indexname:='number';
          stationprinters.setrange([_mycompname,1],[_mycompname,123]) ;
          stationprinters.first;
          while not stationprinters.eof  do begin
            prnums.add(stationprinters.fieldbyname('printernumber').asstring);
            stationprinters.next;
          end;
          stationprinters.cancelrange;
        end;
    chekqtys;  // AS SOON S IT GETS HERE THE VALUE IS '1';

    The even strangerthis is that if I comment out the  

    prnums.add(stationprinters.fieldbyname('printernumber').asstring);

    the value stays to '0'. But then I cannot use the rest of the function, b/c I need the count and the printerindex that

    need to be used. The stationprinters table has no relation to the stringgrid whatsoever.

    Anybody has any hint,clue,suggestion,guessing or anything that can help me avoid going crazy?


  8. Hello.

     

    I submitted 4 bug reports on Quality Portal.

    Where/how can I see a response to them? I only got emails telling me the report was received, 

    but I cannot see anything in Quality Portal  thats shows the stautus of those reports.


  9. HI

    I ccompiled my app and got a warning about an SDK that needed to be load.

    I investigated a bit and I noticed that the Target Platform showd Android64.

    Has anybody experienced his? Maybe there is a keaboard shortcut that can do this and I inadvertently pressed it?

     

    I also experienced a lot of  bugs that I had posted on IDE and API (I .... read only IDE..).

    No answer there but this is wat happens:

    1. " error cannot write the EXE"  

    2. some .ccp file that could not assert something.

    3. at times, Stepping through with f8, the IDE stops responding have to trminate and restart

    4. not too often, but sometimes  the PC just get OTALLY unresponsive. The only way out is  the power button!


  10. HI

    I ccompiled my app and got a warning about an SDK that needed to be load.

    I investigated a bit and I noticed that the Target Platform showd Android64.

    Has anybody experienced his? Maybe there is a keaboard shortcut that can do this and I inadvertently pressed it?

     

    I also experienced a lot of  bugs that I had posted on IDE and API (I .... read only IDE..).

    No answer there but this is wat happens:

    1. " error cannot write the EXE"  

    2. some .ccp file that could not assert something.

    3. at times, Stepping through with f8, the IDE stops responding have to trminate and restart

    4. not too often, but sometimes  the PC just get OTALLY unresponsive. The only way out is  the power button!


  11. HI.

    Is it only me, or in 12.3 (with patches) there are quite a few bugs?

    For examples:

    A) Every second time i make a small change and recompile, I get " error cannot write the EXE"  (paraphrased)

    B) every now and then (more now than then) I get some .ccp file that could not assert something.

    C) Stepping through with f8, usually after a number of steps. The app,stops responding. I have to get out of the IDE, and restart it.

    D) This is bad, bad, bad. Not as often as the other problems; this one just freezes the PC. The only way out is  the power button!

    I placed a report on one of the incidents, but I'm not even sure if they got it or not. (Why is it so complicated to send a technical report?)

     


  12. HI.

    I receive this error (delphi 12,3):

      F2051 Unit VCLTee.TeeProcs was compiled with a different version of Vcl.Menus.TPopupMenu

    I searched for Vcl.Menus.TPopupMenu.* but nothing exists on the PC.

     

    I searched all the VCLTee.TeeProcs.dcu on the PC (attached file (tee.txt)

     

    The only menus file I got is Vcl.Menus.pas, which I included in the app.

    I tried various combinations of the vcltee in the search path, but none seems to work.

     

    By the way, in 

        C:\Program Files (x86)\Embarcadero\Studio\23.0\lib\win32\release

        C:\Program Files (x86)\Embarcadero\Studio\23.0\lib\win64\debug

    what the win32/win64 refer to? The O.S. or the app developed (in 32 bit or 64bit)?

    Also. i should use the dcu from the debug folder in 23.0 if i am compiling my app

      in debug mode and the one from the release folder in 23.0 if i am compiling in release mode?

      

      

    tee.txt


  13. HI.

    This is a mysterious behavior that I had never encountered for decades

    I have 2 showmessage(), then a messagedlg, then THIS problematic showmessage, 

       a simple showmessage('mymessage')..

    The vcl.dialogs.pas (line 6940 on 12.3)

     

      Result := mrNone;
        if LTaskDialog.Execute then
          Result := LTaskDialog.ModalResult;

    when it gets to LTaskDialog.Execute if  shows the message alright but it ALSO makes my custom form visible and I cannot close it in any way. (I must cloe the app)

    Any idea on how to ovrcome this behavioiur?


  14. Thank you all.

    I came up with another solution, wich seems to work

    The objects are either integer (very low, from 1-8)) or a typed (defined) object.

     

    So I do this:

    s:='';
    try
      s:=objects[c,r].classname;  // only the integer objects do not have a classname
    except
    end;
    if s<> '' then
      objects[c,r].free

    Anybody sees some unseen problem with this?


  15. HI.

    I have some stringgrids that use objects.

    For most of them  the object is simply an integer (MySg.objects[c,r]:=Tobject(mynumber);;

    A few use complext object that I declare and assign a Create/destroy consctructor/desctuctor.

    Now when i try to delete an object of the "comples type" all works fine: the destructor takes care of it..

    If i do 

    if assigned(MySg.objects[c,r]) then
      MySg.objects[c,r].free

    On the Integer type, I get an AV exception.

    Perhaps the integer type object does not need to be freed.

    But then how do I inpect if the object is of integer type or not?

    MySG.objects[c,r].classname gives me a "not acessible" message.

    Any helop, please?

     


  16. THanks Olli73. And I found that the error was I  did not add the (pure) text before ading the html part.

    Do you know by the way if Synapse has a way of including a Return-path? It has a Replyto, but I can't find a return-path.


  17. HI. I hoe there si sombody with Synapse experience willing to help.

    I am trying to send an email with an embedded image.

    The html is Trichview created.

    In the richview part, I add the image like thi (MMis the is TMimeMess object from synapse)

        for i := 0 to HTMLImages.Count-1 do begin
          MM.AddPartHTMLBinary(HTMLImages[i].Stream,HTMLImages[i].Name,'<'+HTMLImages[i].Name+'>',MultiPartRel);
        end;

    in the synpase part I have this funcion (by synapse)

    function TMimeMess.AddPartHTMLBinary(const Stream: TStream; const FileName, Cid: string; const PartParent: TMimePart): TMimepart;
    begin
      Result := AddPart(PartParent);
      Result.DecodedLines.LoadFromStream(Stream);
      Result.MimeTypeFromExt(FileName);
      Result.Description := 'Included file: ' + FileName;
      Result.Disposition := 'inline';
      Result.ContentID := Cid;
      Result.FileName := FileName;
      Result.EncodingCode := ME_BASE64;
      Result.EncodePart;
      Result.EncodePartHeader;
    end;

    So the disposition IS "inline", but the recipient get the image as an attachment. I really have no idea of what "CID" (Content ID) should be, i i just pass 

    "<filename>" Wher filename is the filename of the embedded image.


  18. OOps!.

    I got confused .

    What happens is this

    I have this bit of code

     

    begin
    n:=0;
    d:=100/n;
    if d>0 then
    n:=1;
    dm2.tabstable.indexname:='xyz';

    The first error is ignored, no warning, no message.

    The second error is  caught, but it does notshow the call stack, so I do not know WHERE it happens (in this case yes I know, but is

    a nightmare when it may happen God only know where)ERROR.jpg.62301ad34d91b9dad71a2163b32a92c7.jpg 


  19. Thanks to all.

    No, the division by zero was an exampte (and a test I actually didi).

    It is all exceptions (that are not handled)

    The more critical one is when I set a table to an index name that does not esxist. 

    The app just exit, no wrnings.


  20. Hi.

    It is a few days that the IDE does not catch unhandled exceptions. For example, if i put a line with a division by zero, it just goes on. Before the system caught it and the app stopped after the error message. I have checked for any 'forgotten' Application OnException in my code, but I found none.  The settings in Compile and Linking are shown in the attached picture. What else should I check, please? 

    S.jpg


  21. HI.

    Suddenly I am unalbe to create a VCL New Project.

    When I launch it in the IDE it freezes for a long time.

    The task manager shows a strange list of proceses (see attached image.

    This is the project code: (form 3 does nothig, it only contains a stringgrid. Any idea?

    program Project4;
    
    uses
      Vcl.Forms,
      Unit3 in 'Unit3.pas' {Form3};
    
    {$R *.res}
    
    begin
      Application.Initialize;
      Application.CreateForm(TForm3, Form3);
      Application.Run;
    end.

     

    ERROR.jpg


  22. HI.

     

    I had the adventurous idea  of changing the Inactive code opacity in Tools->Editor->language->Error Insight from 30 to 40. 
    Immediately any opacity was lost. 
    Then I played around with values (50, 10, 40, et) and now the code inside an 
    ifdef/endif is opaque (if not applicable) but any commented code remains without any opacity.(see attached picture)
    Any hint as to restore the proper opacity?
    Thanks

    no.jpg

×