The error is caused by the code you added to your project. You are not showing the code so we have no hope of correcting the error. It could be simple as compiling with/without the UNICODE/_UNICODE defines or it may be just broken code.
The error is clearly caused by passing improper arguments to an MFC or ATL class, or Windows API calls. The original cpp file must, therefore, have a dependency on MFC, ATL and Windows API headers/classes whether you intended it to or not. The particular methods are:
// From ATL
LONG QueryStringValue(
LPCTSTR pszValueName,
LPTSTR pszValue,
ULONG* pnChars
) throw( );
// From Windows API (the Wide version of this)
LONG WINAPI RegEnumKeyEx(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPTSTR lpName,
__inout LPDWORD lpcName,
__reserved LPDWORD lpReserved,
__inout LPTSTR lpClass,
__inout_opt LPDWORD lpcClass,
__out_opt PFILETIME lpftLastWriteTime
);
// From ATL
LONG QueryStringValue(
LPCTSTR pszValueName,
LPTSTR pszValue,
ULONG* pnChars
) throw( );
// From Windows API (the Wide version of this)
LONG WINAPI RegEnumKeyEx(
__in HKEY hKey,
__in DWORD dwIndex,
__out LPTSTR lpName,
__inout LPDWORD lpcName,
__reserved LPDWORD lpReserved,
__inout LPTSTR lpClass,
__inout_opt LPDWORD lpcClass,
__out_opt PFILETIME lpftLastWriteTime
);
To copy to clipboard, switch view to plain text mode
The project might have Qt components but the problem is not related to Qt.
Added after 6 minutes:
Does your code around the first call look anything like this?
ATL::CRegKey regkey(...);
TCHAR somebuffer[64];
LONG nChars = 64;
...
LONG ret = regkey.QueryStringValue("valuename", *somebuffer, &nChars);
ATL::CRegKey regkey(...);
TCHAR somebuffer[64];
LONG nChars = 64;
...
LONG ret = regkey.QueryStringValue("valuename", *somebuffer, &nChars);
To copy to clipboard, switch view to plain text mode
If so, drop the asterisk in the method arguments.
Bookmarks