gpt4 book ai didi

c - 在 win32 应用程序中使用 GetDlgItemText()

转载 作者:行者123 更新时间:2023-11-30 21:25:41 24 4
gpt4 key购买 nike

有人可以说明 GetDlgItemText()win32 应用程序中的用法吗?

char msg [DEFAULT_MSGLEN];    
GetDlgItemText(hWnd, IDC_REPLYBOX, (LPSTR)&msg, DEFAULT_MSGLEN);
SetDlgItemText(hWnd, IDC_CHATSCREEN, TEXT(strcat( "YOU : ", msg ));

最佳答案

  1. 如果您的项目是 Unicode,则必须将 msg 定义为 TCHAR 而不是 char
  2. strcat( "YOU : ", msg ) 是严重的错误。分配缓冲区变量,例如TCHAR buf[256],然后 wsprintf( buf, TEXT( "YOU : %s"), msg )

关于c - 在 win32 应用程序中使用 GetDlgItemText(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27816110/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com