Конференция "KOL" » menu problem [Delphi, Windows]
 
  • Jon © (11.11.08 12:17) [20]
    If there is an error in dbdata (I assume it's a file) then the values that you read may be corrupted. Do you have a method for validating its consistency?

    Also, with the new unicode capabilities of KOL, I would use AnsiString instead of String for compatability.
  • arthur (11.11.08 21:45) [21]
    creating one extr menu can't corrupt a file =p
  • Jon © (12.11.08 03:56) [22]
    I used MCK with BAPTrayIcon to create a project to your original specification.
    Form, treeview+popup, trayicon+popup - all work fine with no modifications.
    The link below contains the source files and compiled executable.

    Download link: http://www.megaupload.com/?d=QHIXT875
  • arthur (12.11.08 04:40) [23]
    =o it works, so there must be something wrong with my mck stuff, cuz even using mck menu's i get the error

    tomorrow i will try reinstalling kol and mck and starting a fresh mck project and add my old code to it, maybe it work, who knows =p

    thanks for you time.
  • Jon © (12.11.08 20:09) [24]

    > =o it works

    I wish that I had done that in the first place... ;-)
  • arthur (18.11.08 22:47) [25]
    Jon, after some intense debugging i discovered the problem, it was on my List.Add(), and i already solved it, but i still don't have any idea why it only happens when i create the other menu =p
  • Jon © (19.11.08 02:14) [26]
    There is something strange happening with MCK.
    Take a look at the file: Unit1_1.inc

    In the file that I created and sent previously, the order is:


       Result.TrayMenu := NewMenu(....
       Result.TrayIcon := NewBAPTrayIcon(Applet);
       Result.TrayIcon.PopupMenu := Result.TrayMenu.Handle;



    But when I re-open then re-compile it, the order becomes:


       Result.TrayIcon := NewBAPTrayIcon(Applet);
       Result.TrayIcon.PopupMenu := Result.TrayMenu.Handle;
       Result.TrayMenu := NewMenu(....



    So it tries to add the menu before the menu is created (Runtime Error)!

    The best way around this that I found is to manually edit Unit1_1.inc then compile with the command-line compiler DCC32.exe
  • Jon © (19.11.08 02:23) [27]
    Better solution - Do not add the popup menu with the MCK, but add it to the FormCreate event:


    procedure TForm1.KOLForm1FormCreate(Sender: PObj);
    begin
     TrayIcon.PopupMenu := TrayMenu.Handle;
    end;



    Seems to work every time. I can send another test project if you like.
  • arthur (19.11.08 02:41) [28]
    no need, i was setting it on formcreate before

    thanks anyway
  • Jon © (19.11.08 03:53) [29]

    > but i still don't have any idea why it only happens when i create the other menu

    Can you be more specific?
 
Конференция "KOL" » menu problem [Delphi, Windows]
Есть новые Нет новых   [134431   +15][b:0][p:0.001]