【发布时间】:2011-08-27 19:46:05
【问题描述】:
下面的片段是较大文件中较大函数的一部分。我已将其简化为我认为可以解释我当前问题的基本内容。
我正在使用 Visual Studio 2010。
调用 RegConnectRegistryA 的那一行导致编译器因此警告我:“警告 C4229:使用过时错误:忽略数据的修饰符”。这是编译器输出中唯一的警告或错误。构建确实成功,并且可执行文件按预期运行。但我确实想摆脱那个警告。 (老实说,我认为它已经存在了好几个月了。)
extern "C" __declspec(dllexport) void whoOpsRegistryGetREG_SZ(
LPCSTR szServer,
LPCSTR szKey,
LPCSTR szValue,
char* szReturn,
int iSize)
{
HKEY hKey;
LONG WINAPI lReturn = ::RegConnectRegistryA(
szServer,
HKEY_LOCAL_MACHINE,
&hKey);
}
我在其他帖子中读到的内容让我相信它在某种程度上与#includes 相关。所以他们在这里。如果您需要引号中的任何头文件的内容,请告诉我。
#include "stdafx.h"
#include <windows.h>
#include <initguid.h>
#include <ole2.h>
#include <mstask.h>
#include <msterr.h>
#include <objidl.h>
#include <wchar.h>
#include <stdio.h>
#include <stdarg.h>
#include <lm.h>
#include "whoOpsPrivate.h"
#include "whoOps.h"
#include "jni.h"
#include "whoOps_TaskScheduler.h"
#include "whoOps_ServiceMangler.h"
#include "whoOps_RegistryRaptor.h"
#include "../../cyclOps.h"
谢谢!
【问题讨论】: