I get the following error:
error C2440: \'type cast\' : cannot convert from \'std::_Vector_iterator<_Ty,_Alloc>\' to \'DWORD\'
with
[
Is your goal to just get rid of the error or to make the program correct? In the latter case you would have to tell us what you are actually trying to do.
Since you didn't I have to guess. My guess is you want to convert an address of the first LPCSTR
in the vector to DWORD
. If your code worked in the previous version of VS, this is the more probable scenario. If I'm right try this:
*(DWORD*)(offset+0x571) = (DWORD)(&factions.front());
or this:
*(DWORD*)(offset+0x571) = (DWORD)(&*factions.begin());
or this:
*(DWORD*)(offset+0x571) = (DWORD)(&factions[0]);
If you want to convert the LPCSTR
stored at the front of your vector to DWORD
do this:
*(DWORD*)(offset+0x571) = (DWORD)factions.front();
or this:
*(DWORD*)(offset+0x571) = (DWORD)(*factions.begin());
or this:
*(DWORD*)(offset+0x571) = (DWORD)(factions[0]);