我的源程序在D6下编译没有任何问题,可是在D7下编译却出现一大堆Warning!但是可以Build成功……

解决方案 »

  1.   

    [Warning] UDMod.pas(92): Unsafe type 'TBook'
      [Warning] UDMod.pas(100): Unsafe type 'pBookMark: Pointer'
      [Warning] UDMod.pas(119): Unsafe type 'pBookMark: Pointer'
      [Warning] UDMod.pas(120): Unsafe type 'pBookMark: Pointer'
      [Warning] UBillQry.pas(150): Unsafe type 'TBook'
      [Warning] UBillQry.pas(157): Unsafe type 'pBM: Pointer'
      [Warning] UBillQry.pas(165): Unsafe type 'pBM: Pointer'
      [Warning] UBillQry.pas(166): Unsafe type 'pBM: Pointer'
    [Warning] UApi.pas(123): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(129): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(130): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(133): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(134): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(142): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(145): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(154): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(158): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(160): Unsafe type 'Pointer'
    [Warning] UApi.pas(167): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(169): Unsafe type 'Pointer'
    [Warning] UApi.pas(171): Unsafe type 'LPTSTR'
    [Warning] UApi.pas(173): Unsafe type 'Pointer'
    [Warning] UApi.pas(185): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(188): Unsafe type 'LPCTSTR'
    [Warning] UApi.pas(206): Unsafe type 'Pointer'
    [Warning] UApi.pas(225): Unsafe type 'Pointer'
    [Warning] UApi.pas(254): Unsafe type 'PChar'
    [Warning] UApi.pas(254): Unsafe type 'PChar'
    [Warning] UApi.pas(255): Unsafe type 'PChar'
    [Warning] UApi.pas(255): Unsafe code '@ operator'
    [Warning] UApi.pas(255): Unsafe code '@ operator'
    [Warning] TrayIcon.pas(72): Symbol 'AllocateHWnd' is deprecated
    [Warning] TrayIcon.pas(77): Symbol 'DeallocateHWnd' is deprecated
    [Warning] TrayIcon.pas(93): Unsafe typecast of 'Integer' to 'TTrayNotifyIcon'
    [Warning] TrayIcon.pas(168): Unsafe type 'IDI_WINLOGO: PAnsiChar'
    [Warning] TrayIcon.pas(210): Unsafe type 'PChar'
    [Warning] TrayIcon.pas(212): Unsafe typecast of 'TTrayNotifyIcon' to 'Cardinal'
    [Warning] TrayIcon.pas(217): Unsafe code '@ operator'
    [Warning] UMain.pas(120): Unsafe type 'PChar'
    [Warning] UMain.pas(124): Unsafe type 'PChar'
    [Warning] UMain.pas(124): Unsafe type 'PChar'
    [Warning] UMain.pas(199): Unsafe code '@ operator'
    [Warning] UMain.pas(199): Unsafe code '@ operator'
    [Warning] UMain.pas(199): Unsafe code '@ operator'
    [Warning] UMain.pas(199): Unsafe code '@ operator'
    [Warning] UMain.pas(199): Unsafe code '@ operator'
    [Warning] UMain.pas(199): Unsafe code '@ operator'
    [Warning] UMain.pas(200): Unsafe code '@ operator'
    [Warning] UMain.pas(200): Unsafe code '@ operator'
    [Warning] UMain.pas(200): Unsafe code '@ operator'
    [Warning] UMain.pas(200): Unsafe code '@ operator'
    [Warning] UMain.pas(200): Unsafe code '@ operator'
    [Warning] UMain.pas(200): Unsafe code '@ operator'
    [Warning] UMain.pas(200): Unsafe code '@ operator'
    [Warning] UMain.pas(200): Unsafe code '@ operator'
    [Warning] UMain.pas(200): Unsafe code '@ operator'
      

  2.   

    是如此,可以在 project->options->compiler messages 中最后几个
    unsave type     X
    unsave code     X
    unsave typecast X
      

  3.   

    {$IFDEF VER150}
      {$WARN UNSAFE_TYPE OFF}
      {$WARN UNSAFE_CODE OFF}
      {$WARN UNSAFE_CAST OFF}
    {$ENDIF}
      

  4.   

    delphi7开始不建议使用指针,或类似的,如S: string , s[1], s[2]...就会是类似指针操作。
      

  5.   

    TQuery控件以前是不需要设置Parameter的type的,现在要是不设就跳出错误,而ADO DBEXPRESS IBX等没有这个要求
    如select * from tables where id = :myid
    好象一定要把myid的类型设置为与id相同才行