I have a project which I need to get working in C++ in VS2010 under Windows 7. The project was originally developed to run on WinCE . It was developed in VC++ but linked to some libraries used in the WinCE dev environment.
The project uses ::VirtualCopy which fails to compile as I believe it’s in Coredll.lib. in the WinCE environment. https://msdn.microsoft.com/en-us/library/aa450977.aspx
error LNK2028: unresolved token (0A000B85) "extern "C" int __cdecl VirtualCopy(void *,void *,unsigned long,unsigned long)" (?VirtualCopy@@$$J0YAHPAX0KK@Z) referenced in ..
error LNK2019: unresolved external symbol "extern "C" int __cdecl VirtualCopy(void *,void *,unsigned long,unsigned long)" (?VirtualCopy@@$$J0YAHPAX0KK@Z) referenced in ..
The function in my code is reference through:
extern "C"
{
BOOL VirtualCopy(LPVOID lpvDest, LPVOID lpvSrc, DWORD cbSize, DWORD fdwProtect);
}
And then used:
if( ! ::VirtualCopy(pVMem, reinterpret_cast<void *>(dwASIC_REGISTERS_BASE), tSystemInfo.dwPageSize, PAGE_READWRITE | PAGE_NOCACHE) )
{
DWORD dwError = ::GetLastError();
TRACE1("Failed ", dwError);
return;
}
The projects uses:
- MFC in a shared dll
- Static link to ATL
- Common Language Runtime Support (/clr)
I have a few of question:
- Is there an alternative?
- Is there any way I can import some of the old winCE libraries and link against those, allowing me to use this function?
Any help would be greatly appreciated
Many Thanks