下段是在一個較大的文件的較大功能的一部分。我已經減少到了我認爲是解釋我目前問題的要點。警告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'(英特爾)。 –