Command line program work but same on Lazarus crash.<br><br>Perhaps the statements of COM are different between Delphi and Lazarus?<br>If someone work on this ?<br><br>I'm based of this<br><a href="http://etutorials.org/Programming/Pocket+pc+network+programming/Chapter+9.+Desktop+Synchronization/Desktop+Connection+Notifications/">http://etutorials.org/Programming/Pocket+pc+network+programming/Chapter+9.+Desktop+Synchronization/Desktop+Connection+Notifications/</a><br>

<br>I add backtrace and some info<br>[code]<br>type<br><br>  PIDccManSink = ^IDccManSink;<br><br>  IDccManSink = interface(IUnknown)<br>    ['{A7B88840-A812-11cf-8011-00A0C90A8F78}']<br>    function OnLogIpAddr(dwIpAddr: DWORD): HResult; stdcall;<br>

    function OnLogTerminated: HResult; stdcall;<br>    function OnLogActive: HResult; stdcall;<br>    function OnLogInactive: HResult; stdcall;<br>    function OnLogAnswered: HResult; stdcall;<br>    function OnLogListen: HResult; stdcall;<br>

    function OnLogDisconnection: HResult; stdcall;<br>    function OnLogError: HResult; stdcall;<br>  end;<br><br><br>  IIDccMan = interface(IUnknown)<br>    ['{A7B88841-A812-11cf-8011-00A0C90A8F78}']<br>    function Advise(pDccSink: PIDccManSink; var pdwContext: DWORD): HResult; stdcall;<br>

    function Unadvise(dwContext: DWORD): HResult; stdcall;<br>    function ShowCommSettings: HResult; stdcall;<br>  end;<br><br>{$M+}<br>  TDccMan = class;<br><br>  { TDccEventSink }<br><br>  TDccEventSink = class(IUnknown, IDccManSink)<br>

  private<br>    FNbRef:      integer;<br>    FOnLogEtat:  string;<br>    FOnLogIndex: integer;<br>    FOwner:      TDccMan;<br>  public<br>    { IUnknown }<br>    function QueryInterface(const IID: TGUID; out Obj): HRESULT; stdcall;<br>

    function _AddRef: integer; stdcall;<br>    function _Release: integer; stdcall;<br>    { IDccManSink}<br>    function OnLogIpAddr(dwIpAddr: DWORD): HResult; stdcall;<br>    function OnLogTerminated: HResult; stdcall;<br>

    function OnLogActive: HResult; stdcall;<br>    function OnLogInactive: HResult; stdcall;<br>    function OnLogAnswered: HResult; stdcall;<br>    function OnLogListen: HResult; stdcall;<br>    function OnLogDisconnection: HResult; stdcall;<br>

    function OnLogError: HResult; stdcall;<br>    constructor Create(AOwner: TDccMan);<br>    destructor Destroy; override;<br>    property OnLogEtat: string Read FOnLogEtat;<br>    property OnLogIndex: integer Read FOnLogIndex;<br>

  end;<br><br>  { TDccMan }<br><br>  TDccMan = class(TObject)<br>  private<br>    FIDccMan: IIDccMan;<br>    FdwContext: DWORD;<br>    FDccSync: TDccEventSink;<br>    FIDccManSink: PIDccManSink;<br>    FComLib: boolean;<br>

    FQI:     boolean;<br>    FAdvise: boolean;<br>    FOnChange: TNotifyEvent;<br>    procedure DoChange(Sender: TObject);<br>    function GetStatusStr: string;<br>    function GetStatusIndex: integer;<br>  public<br>    constructor Create;<br>

    destructor Destroy; override;<br>    procedure Advise;<br>    procedure Unadvise;<br>    procedure ShowCommSettings;<br>    property StatusStr: string Read GetStatusStr;<br>    property StatusIndex: integer Read GetStatusIndex;<br>

  published<br>    property OnChange: TNotifyEvent Read FOnChange Write FOnChange;<br>  end;<br>[/code]<br><br>The procedure associed to OnChange (this make crash) <br><br>[code]<br>procedure TForm1.Change(Sender: TObject);<br>

begin<br>  Label1.Caption:=DccMan.StatusStr;<br>end;<br>[code]<br><br>[bt]<br>C:\lazarus\project\wince\test>..\..\..\mingw\bin\gdb project1.exe<br>GNU gdb 6.8<br>Copyright (C) 2008 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>><br>

This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law.  Type "show copying"<br>and "show warranty" for details.<br>This GDB was configured as "i686-pc-mingw32"...<br>

(gdb) r<br>Starting program: C:\lazarus\project\wince\test/project1.exe<br>[New thread 2080.0x66c]<br>[New thread 2080.0xe40]<br>warning: Lowest section in C:\WINWKS\system32\xpsp2res.dll is .rsrc at 20001000<br>[New thread 2080.0xf74]<br>

[New thread 2080.0xc2c]<br>[New thread 2080.0x7a8]<br>[New thread 2080.0xf04]<br><br>Program received signal SIGSEGV, Segmentation fault.<br>0x0040a341 in fpc_popaddrstack ()<br>(gdb) bt<br>#0  0x0040a341 in fpc_popaddrstack ()<br>

#1  0x000e62b8 in ?? ()<br>#2  0x004cd6df in SENDPAINTMESSAGE (CONTROLDC=0, parentfp=0x1ecfce8)<br>    at win32callback.inc:553<br>#3  0x004ca7d1 in WINDOWPROC (WINDOW=7800458, MSG=15, WPARAM=0, LPARAM=0)<br>    at win32callback.inc:2152<br>

#4  0x7e418734 in USER32!GetDC () from C:\WINWKS\system32\user32.dll<br>#5  0x0077068a in ?? ()<br>#6  0x0000000f in ?? ()<br>#7  0x00000000 in ?? ()<br>(gdb)<br>[bt]<br><br>-- <br>Laurent.<br><br>