short devid;
	short devId;

	devId = GetDeviceIDFromRealID(m_seDeviceID.GetBuffer(129));
	if (dev.Open(&g_conn))
	{	
		dev.SetDEV_ID(devId);
		ok = dev.LookupForward();
		dev.GetDEV_ID(devid);
		if (ok && (devid == devId))
		{

... :]