'SHGFP_TYPE_CURRENT'未在此范围中声明 [英] 'SHGFP_TYPE_CURRENT' was not declared in this scope

查看:569
本文介绍了'SHGFP_TYPE_CURRENT'未在此范围中声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一个巨大的项目从Qt 4.x迁移到5,(事实上,我在这里请求帮助几次,我不能更感谢你的帮助)。
我得到下一个错误:

I am migrating a huge project from Qt 4.x to 5, (in fact I have asked for help several times here, I couldnt be more grateful for your help). I am getting the next error:


.. \marssies\userlayerswidget.cpp:在成员函数'void
LayersModel :: importFromOld()':
.. \marssies\userlayerswidget.cpp:1736:60:错误:'SHGFP_TYPE_CURRENT'
未在此范围中声明< b>

..\marssies\userlayerswidget.cpp: In member function 'void LayersModel::importFromOld()': ..\marssies\userlayerswidget.cpp:1736:60: error: 'SHGFP_TYPE_CURRENT' was not declared in this scope

它没有太大的意义,因为我有正确的标题包括,这里是所有的包括:

It doesnt make too much sense, as I have the correct header included, here are all the includes:

#include "userlayerswidget.h"
#include "appcommon.h"
#include "messagebox.h"
#include "polyline.h"
#include "painterbar.h"
#include "rectangle.h"
#include "polygon.h"
#include "label.h"
#include "line.h"
#include "point.h"
#include "encsymbol.h"
#include "touchswibz.h"
#include "mapmodulelist.h"
#include "offlinelayersaver.h"
#include "circle.h"

#include <QMenu>
#include <QDir>
#include <QDesktopServices>
#include <QtDebug>

#ifdef _WIN32
#include <Shlobj.h>
#endif

这里是使用SHGFP_TYPE_CURRENT的代码片段:

And here is the piece of code that makes use of SHGFP_TYPE_CURRENT:

void LayersModel::importFromOld() {
TCHAR appPath[MAX_PATH];
if (!(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appPath))) {
    //code
}

我已经研究过,一切正常,根据 http://msdn.microsoft.com/en-us/library/bb762181%28VS.85%29.aspx

我试着找到其他人有相同的问题,但上下文不同或问题没有回答。

谢谢。

I have researched and everything is correct according to http://msdn.microsoft.com/en-us/library/bb762181%28VS.85%29.aspx
I tried to find other people with the same problem but either the context was different or the question wasnt answered.
Thankyou.

推荐答案

p>做更多的研究我有一个答案是用CSIDL_INTERNET_CACHE替换SHGFP_TYPE_CURRENT,我做了它和它编译,但我不知道如果它会是一样的(我没有写这个程序,我只是迁移它)所以,如果有人可以给一些洞察力会很好。

Doing more research I an answer that was to replace SHGFP_TYPE_CURRENT with CSIDL_INTERNET_CACHE, I did it and it compiled, but Im not sure if it will be the same (I havent written this program, Im just migrating it) So if anybody could give some insight it would be nice.

资料来源: http://www.dreamincode.net/forums/topic/200660-undeclared-variable/

这篇关于'SHGFP_TYPE_CURRENT'未在此范围中声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆