error C2664: 不能将参数 1 从“const cha

2023-05-24  本文已影响0人  雯饰太一

原因:没有设置多字符集

解决方案:

prsht.h(643): error [该文件中出现的相关错误]

1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\prsht.h(643): error C2146: 语法错误: 缺少“;”(在标识符“hdr”的前面)
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\prsht.h(643): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\prsht.h(643): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int

//对应代码中的位置如下:
typedef struct _PSHNOTIFY
{
    NMHDR hdr;
    LPARAM lParam;
} PSHNOTIFY, *LPPSHNOTIFY;

if (dRetCode != 0) 
{
    AttachConsole(GetCurrentProcessId());
}

解决方法:

在某个主要的.h文件中,[#include <Windows.h>]

备注:上述错误是因为找不到声明,只需要将其引入即可

但是具体怎么定位是在哪个文件中添加就不知道了,当时也只是歪打正着。

若是有益,望君不吝点赞~

上一篇 下一篇

猜你喜欢

热点阅读