Advertisement
bitelaserkhalif555

problematic conversion from int to intptr

Oct 4th, 2020 (edited)
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. string pIDs = Convert.ToString(p.Id);//p.Id is an integer. Will convert to string to retain value.
  2. IntPtr pID = new IntPtr(Convert.ToInt32(pIDs, 16));//This will converted to hexadecimal but the value doesn't change.
  3.  
  4. Errors:
  5. > An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in FrozUn.exe
  6. Exception from HRESULT: 0xC000000
  7. > I wanted 0x8456 but in the end I got 0x0000000000008456 (intPtr) from 8456 (integer)
  8.  
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement