请问怎么把String转换成PAnsiChar?[Error] Unit1.pas(109): Incompatible types: 'String' and 'PAnsiChar'

jerry_huang 2005-05-18 09:48:11
Application.MessageBox('Couldn''t find the pattern!','Error',MB_OK+MB_ICONINFORMATION+MB_DEFBUTTON1)

[Error] Unit1.pas(109): Incompatible types: 'String' and 'PAnsiChar'
...全文
838 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ly_liuyang 2005-05-18
  • 打赏
  • 举报
回复
用强制类型转换!

http://lysoft.7u7.net
hellolongbin 2005-05-18
  • 打赏
  • 举报
回复
全部用PChar括起来
jerry_huang 2005-05-18
  • 打赏
  • 举报
回复
不,我的意思是说如果你再加上一个 'Couldn''t find the pattern!'+cPattern

而这个cPattern是String型的,你就会看到这个错误信息了
fenglaile 2005-05-18
  • 打赏
  • 举报
回复
Application.MessageBox(Pansichar('Couldn''t find the pattern!'),'Error',MB_OK+MB_ICONINFORMATION+MB_DEFBUTTON1)
hellolongbin 2005-05-18
  • 打赏
  • 举报
回复
我这试没有问题
改成
Application.MessageBox(Pchar('Couldn''t find the pattern!'),'Error',MB_OK+MB_ICONINFORMATION+MB_DEFBUTTON1)
试试
jerry_huang 2005-05-18
  • 打赏
  • 举报
回复
Issue closed; Thanks!

16,742

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧