Im trying to convert a basic "game" engine from win32 (32bit) to x64 to fully support 64bit. This engine was made for learning c++ in my high college (to visualy create standard games). But the problem is when i compile this code in x64 it gives some errors that i cannot solve because i dont know that mutch of c++. (The code was created in visual studio 2010 ).
I'm trying to recreate the engine so that it can be used for 32bit and 64bit applications
The code can be found her (didnt know how to upload all the different files to this site:
Fadaria.rar
tnx for helping me out with this
EDIT: some errors + code
Error 5 error C2664: 'WriteFile' : cannot convert parameter 4 from 'DWORD_PTR *' to 'LPDWORD'
Code:
void Bitmap::Extract(WORD id, tstring sType, tstring fileName) const
{
CreateDirectory(_T("temp\\"), NULL);
HRSRC hrsrc = FindResource(NULL, MAKEINTRESOURCE(id), sType.c_str());
HGLOBAL hLoaded = LoadResource( NULL, hrsrc);
LPVOID lpLock = LockResource(hLoaded);
DWORD_PTR dwSize = SizeofResource(NULL, hrsrc);
HANDLE hFile = CreateFile(fileName.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
DWORD_PTR dwByteWritten;
WriteFile(hFile, lpLock , dwSize , &dwByteWritten , NULL);
CloseHandle(hFile);
FreeResource(hLoaded);
}
EDIT: more errors
Error 3 error C2440: '=' : cannot convert from 'LRESULT (__cdecl *)(HWND,UINT_PTR,WPARAM,LPARAM)' to 'WNDPROC'
Code:
bool GameEngine::ClassRegister(int iCmdShow)
{
WNDCLASSEX wndclass;
// Create the window class for the main window
wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
And there are a few warnings like this:
Warning 8 warning C4244: 'argument' : conversion from 'UINT_PTR' to 'UINT', possible loss of data
The files where i get those errors are included in this post