
UpdateData(TRUE);			// get data from the GUI
	if(m_strRegAddr.Find("0x") == -1) m_strRegAddr = "0x" + m_strRegAddr;
	byte byValue = ((DWORD)strtoul(m_strRegAddr, NULL, 16) <256)? (DWORD)strtoul(m_strRegAddr, NULL, 16) :255;
								//	strtoul converst a string into an unsigned-long-integer -- string which must be converted, 
								//  If endptr is not NULL, a pointer to the character that stopped the scan is stored at the location pointed to by endptr,
								//	it stops reading in till it finds a value larger than expressed, this case 16.
	byValue = (byValue >0) ? byValue :0;		// ? is kind of if statement if (...) is true than x : else y
	m_strRegAddr.Format("0x%x",byValue);	// herewith you put it back in edit box with 0x and than the hex value
	UpdateData(FALSE);
	device = byValue;
	 
