Конференция "KOL" » modify a little code, kol can write win64 program
 
  • dotnet20 (26.02.14 10:45) [0]
    win7 x64, delphi xe2, KOL3.21
    ----------------------------------
    {$DEFINE x64} in project condition define
    ----------------------------------
    1)delphicommctrl.inc

       TMsg = packed record
       CASE Integer OF
       0:  (
           hwnd: HWND;
           message: UINT;
           {$IFDEF x64}
           _x64_DW1: DWORD;
           {$ENDIF}
           wParam: WPARAM;
           lParam: LPARAM;
           time: DWORD;
           pt: TPoint;
           {$IFDEF x64}
           _x64_DW2: DWORD;
           {$ENDIF}
           );
       //1:  ( Bmsg: Windows.TMsg; );
       2:  ( Cmsg: TMsgDecoded; );
       end;

    2)MsgDecode.pas
    ----------------------------------------------
     TMsgDecoded = packed record
       hwnd: HWND;
       Cmessage: TMessageDecoded;
       _filler: Word;
       {$IFDEF x64}
       _x64_DW1: DWORD;
       {$ENDIF}
       wParam: WPARAM;
       lParam: LPARAM;
       time: DWORD;
       pt: TPoint;
       {$IFDEF x64}
       _x64_DW2: DWORD;
       {$ENDIF}
     end;
  • dotnet20 (26.02.14 10:51) [1]
    if use {$DEFINE UNICODE_CTRLS},

    const "EditActions_Packed"  declare must modify, otherwise, editbox can't input any char
  • Netspirit (26.02.14 19:42) [2]
    This is because KOL disables aligning ({$A-}). Same with KOL.TMenuitemInfo.
    Why KOL redeclare this (e.g. not uses this records from Windows unit)...

    "Little code"? You are optimist :-)
  • dotnet20 (27.02.14 04:24) [3]
    I Only test my old progaram in win32, not fully test all controls.

    I can't undstand why kol define {$A-}, redeclare TMSG, this seems strange.

    I think win32, win64, unicode support compatible with delphi, freepacal is the most import things to KOL new version, 100-200bytes reduce is not the most import.
  • Дмитрий К © (27.02.14 07:59) [4]

    > I think win32, win64, unicode support compatible with delphi,
    >  freepacal is the most import things to KOL new version,
    >  100-200bytes reduce is not the most import.

    Then please try this http://yadi.sk/d/Z0uMP31_67nJY
    It is my adaptation of KOL for x64 delphi compilers and for fpc.
  • dotnet20 (28.02.14 12:19) [5]
    thanks a lot :)
  • Thaddy © (01.03.14 15:49) [6]
    Can we host that on kolmck.net as unofficial translation?
    I am interested in merging some of my 64bit code into it, but you beat me with a full version ;)

    I am sure Vladimir will have a look at it. (and can make it official)

    Will experiment with it in the weekend.

    Regards,

    Thaddy
  • thaddy © (01.03.14 16:02) [7]
    First test observation:

    Too much int64 instead of NativeInt. The code would be more compatible if you observe the native types. It would be possible to keep one source for both 32bit and 64bit. For older compilers we can define the NativeInt, NativeUINT etc types.
  • thaddy © (01.03.14 16:10) [8]
    Also, for both Freepascal and Delphi, {$DEFINE WIN64} is better than X64, because the compilers already understand that. After 5 minutes first compiled kol app based on kolappexpert ;-) Good work.
  • thaddy © (01.03.14 16:54) [9]
    Observation 2: simple kolform64 fpc:64000 bytes, DCC64:84992 bytes.
    FPC271 generates smaller code... ;-)
  • Thaddy © (02.03.14 08:23) [10]
    Of course I mean {$IFDEF WIN64}, not $DEFINE ...., because it is implicitly defined as WIN64.
    Also my kol notepad code runs in unicode 64 bit and I have no problems yet.
    Again, good work!
  • Дмитрий К © (03.03.14 00:57) [11]
    Thank you, Thaddy. Your opinion is much appreciated. But I'm afraid you were testing some other translation. In my version I use the type which is defined in FPC: PtrInt/PtrUInt, and I define it like this in kol.pas:
    {$IFNDEF FPC}
    type
    {$IFDEF WIN64}
     PtrUInt = NativeUInt;
     PtrInt = NativeInt;
     PPtrUInt = PNativeUInt;
     PPtrInt = PNativeInt;
    {$ELSE}
     PtrUInt = Cardinal;
     PtrInt = Integer;
     PPtrUInt = ^Cardinal;
     PPtrInt = ^Integer;
    {$ENDIF}
    {$ENDIF}

    .
    So my translation is compatible with the 32-bit compilers (even with D2, but this is thanks to Vladimir Kladov of course). And I don't use X64 symbol, only WIN64 as you suggested.

    And answering your question, yes you can host it on kolmck.net.
  • Thaddy © (03.03.14 17:57) [12]
    Ok, I will ask Vladimir to do that. You patch seems not intrusive and I have been playing with it all weekend ;-) Most, but not all of my projects (remember I do not use mck) compile with very little or no change....
    I will write a little article about it later today on fpc.thaddy.com.
    VERY good work.

    For those who want to test:

    Here's my commandline kolwhois for fpc2.7.1:
    c:\kolx64>ppcrossx64 -Mdelphi -Rintel -OpATHLON64 -CX -XX -Xs -O4 -Os -B  -CpATHLON64 -CfSSE3 -FuC:\fpc\trunk\packages\winunits-base\src;C:\fpc\trunk\packages\rtl-objpas\src\inc;C:\fpc\trunk\packages\rtl-objpas\src\win;C:\fpc\trunk\packages\rtl-extra\src\win -FiC:\fpc\trunk\packages\rtl-objpas\src\inc  whoiskol.dpr

    Note you need a fresh build from today/now , because Michael van Canneyt and me fixed winsock.pp 10 minutes ago ;) There will be more fpc side fixes when accepted, so the strange incompatibilities between delphi-win and fpc-win go away.
  • Thaddy © (03.03.14 17:57) [13]
    Ok, I will ask Vladimir to do that. You patch seems not intrusive and I have been playing with it all weekend ;-) Most, but not all of my projects (remember I do not use mck) compile with very little or no change....
    I will write a little article about it later today on fpc.thaddy.com.
    VERY good work.

    For those who want to test:

    Here's my commandline kolwhois for fpc2.7.1:
    c:\kolx64>ppcrossx64 -Mdelphi -Rintel -OpATHLON64 -CX -XX -Xs -O4 -Os -B  -CpATHLON64 -CfSSE3 -FuC:\fpc\trunk\packages\winunits-base\src;C:\fpc\trunk\packages\rtl-objpas\src\inc;C:\fpc\trunk\packages\rtl-objpas\src\win;C:\fpc\trunk\packages\rtl-extra\src\win -FiC:\fpc\trunk\packages\rtl-objpas\src\inc  whoiskol.dpr

    Note you need a fresh build from today/now , because Michael van Canneyt and me fixed winsock.pp 10 minutes ago ;) There will be more fpc side fixes when accepted, so the strange incompatibilities between delphi-win and fpc-win go away.
  • Thaddy © (04.03.14 20:58) [14]
    Dimitry, I put this on the fpc developers list:
    ----
    For anyone developing with KOL, Dmitry K did a - as yet unofficial - 64 bit Windows version that is sufficiently stable to be considered to be added to the official branch at kolmck.net.
    You can obtain it here: http://yadi.sk/d/Z0uMP31_67nJY

    If you are interested and know something about how to use KOL/MCK, plz test and let me know.

    Remember to compile with at least -Mdelphi  -Rintel -dPUREPASCAL
    Unicode version doesn't require -Mdelphiunicode but rather: -dUNICODE_CTRLS
    This is because KOL already had unicode before FPC.

    Thaddy

    p.s.:
    ppcrossx64 outperforms dcc64 in size and speed, at least with KOL.

    ---
  • Thaddy © (04.03.14 20:58) [15]
    Dimitry, I put this on the fpc developers list:
    ----
    For anyone developing with KOL, Dmitry K did a - as yet unofficial - 64 bit Windows version that is sufficiently stable to be considered to be added to the official branch at kolmck.net.
    You can obtain it here: http://yadi.sk/d/Z0uMP31_67nJY

    If you are interested and know something about how to use KOL/MCK, plz test and let me know.

    Remember to compile with at least -Mdelphi  -Rintel -dPUREPASCAL
    Unicode version doesn't require -Mdelphiunicode but rather: -dUNICODE_CTRLS
    This is because KOL already had unicode before FPC.

    Thaddy

    p.s.:
    ppcrossx64 outperforms dcc64 in size and speed, at least with KOL.

    ---
  • Дмитрий К © (04.03.14 22:26) [16]
    OK, thank you.
  • Awkward © (08.03.14 18:25) [17]
    KolEdb.pas, Err.pas не компилируются с этой версией KOL. Первый - ещё и потому, что в KOL.pas игнорируются ассемблерные функции
    function Int64_2Str( X: I64 ): AnsiString;
    function Int64_2Hex( X: I64; MinDigits: Integer ): KOLString;
    function Str2Int64( const S: AnsiString ): I64;
    function Int64_2Double( const X: I64 ): Double;
    function Double2Int64( D: Double ): I64;

  • Awkward © (08.03.14 18:27) [18]
    Поправка: не компилируется для FPC
  • Thaddy © (14.03.14 16:19) [19]
    err.pas is not translated for 64 bit, but the other functions should work. Also, fpc can now handle the asm code from kol. Can you give a small example that fails with fpc2.7.1 trunk?
  • dotnet20 (24.04.14 10:06) [20]
    Дмитрий К © KOLx64  is more stable than official, it resolve some bugs, it can compiled in XE2 without any change. but also have unicode bugs in east-asia windows like official version. elg: editbox can't input any charater.
  • dotnet20 (25.04.14 04:02) [21]
    sugeest: kol new version base on Дмитрий К © KOLx64, let kol more powerful
  • dotnet20 (28.04.14 07:20) [22]
    Дмитрий К © KOLx64 can work for lazarus1.2.0 win32, win64 without any code change.
  • max (26.05.14 13:16) [23]
    Is it possible to get MCK ported for lazarus 64bit?
  • Thaddy © (29.06.14 12:09) [24]
    Possible, yes. Should be quite easy to do.
    But I don't use MCK nor Lazarus so I can't help.
  • Thaddy © (29.06.14 12:09) [24]
    Possible, yes. Should be quite easy to do.
    But I don't use MCK nor Lazarus so I can't help.
  • Thaddy © (29.06.14 12:09) [24]
    Possible, yes. Should be quite easy to do.
    But I don't use MCK nor Lazarus so I can't help.
  • Veljko (25.11.15 02:18) [27]
    That's not just logic. That's really selsibne.
  • Dayane (25.11.15 03:16) [28]
    For one thing,  Connect  will set both the Name and Port for you, so you can limit the code to justClient := TSocketObj.Create;Connect('192.168.1.100 ,1234);but doing it your way shouldn't cause a pbeolrm.  What exception (if any) is it throwing?As for demo, one of the best demos is already in the code.  Look at how THTTPGetObj uses the underlying socket.
  • Steve (09.01.18 18:05) [29]
    Does anyone have a copy of the file kol322-x64-unofficial.7z? It's not possible to download it from the new site kolmck.ru
  • Netspirit (10.01.18 12:24) [30]
  • Dimaxx © (10.01.18 16:08) [31]
    Кстати, нет смысла использовать PtrInt - с D7 (а может быть и с D5) можно напрямую писать NativeInt/NativeUInt, а про версии ниже 7 уже пора забыть. FPC также понимает их в зависимости от разрядности.
  • Netspirit (10.01.18 18:36) [32]
    Я в своей редакции KOL использую NativeInt/NativeUInt
  • Netspirit (11.01.18 13:57) [33]
    Следует учитывать, что NativeInt/NativeUInt в Delphi до версии 2009 были объявлены неправильно и имели размер 8 байт вместо 4-х. Нужно переобъявлять этот тип в этих версиях. Вероятно, с этим может быть связано желание использовать PtrInt вместо NativeInt.
  • Dimaxx © (11.01.18 16:00) [34]
    Согласен, наврал. Сейчас проверил - действительно, в D7 NativeInt фактически идентичен int64. Но их можно переопределить. Тогда в КОЛе для delphi ниже 2009 переопределить NativeInt = integer и NativeUInt = dword вместо Ptr'ов, в остальных случаях ничего не переопределять. И везде в KOL заменить на NativeInt/NativeUInt.

    Кстати, можно переопределить в заменах системных модулей. Прописал в System.pas правильно и шабаш. Если уж пользоваться KOL, то с заменой.
 
Конференция "KOL" » modify a little code, kol can write win64 program
Есть новые Нет новых   [91076   +10][b:0.001][p:0.004]