下段是在一个较大的文件的较大功能的一部分。我已经减少到了我认为是解释我目前问题的要点。警告C4229:不合时宜应用于:在数据改性剂被忽略
我使用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"
谢谢!
耶!那样做了。在不熟悉的领域工作时,这就是使用复制粘贴继承的方法。 –
更具体地说,如果正确地记得'__stdcall' /'WINAPI'为'__pascal'和'__far __pascal'的替代品。它完全被64位编译器忽略,因为目前唯一可用于x64处理器的Windows调用约定是'__fastcall'(x64)(通常称为“x64调用约定”或“MS x64调用约定”),__vectorcall '(x64)(MSVC)和'__regcall'(英特尔)。 –