Application.MessageBox('Couldn''t find the pattern!','Error',MB_OK+MB_ICONINFORMATION+MB_DEFBUTTON1)[Error] Unit1.pas(109): Incompatible types: 'String' and 'PAnsiChar'

解决方案 »

  1.   

    我这试没有问题
    改成
    Application.MessageBox(Pchar('Couldn''t find the pattern!'),'Error',MB_OK+MB_ICONINFORMATION+MB_DEFBUTTON1)
    试试
      

  2.   

    Application.MessageBox(Pansichar('Couldn''t find the pattern!'),'Error',MB_OK+MB_ICONINFORMATION+MB_DEFBUTTON1)
      

  3.   

    不,我的意思是说如果你再加上一个 'Couldn''t find the pattern!'+cPattern而这个cPattern是String型的,你就会看到这个错误信息了
      

  4.   

    用强制类型转换!http://lysoft.7u7.net