I've noticed that 1st exceptions always take a while to be thrown to your program (at least with file ops anyway). Then any following exceptions are thrown immediately. Does anyone know how to make 1st ones throw immediately? Thanks - Gary.
gdocherty
Posts
-
Exceptions -
drag and dropHi, A better way is to create a temporary transparent window which covers the whole screen. Use GetSystemMetrics(SM_CXSCREEN) and GetSystemMetrics(SM_CYSCREEN) to get the window dims. Use its mouse events to control the drag.
-
usb detectionHi, You can use DirectInput and the EnumDevices method (with visual c++) to tell you how many mouses are connected to the PC. Perhaps in a background program which checks them every now and then.
-
Rect Value AGAIN!!!!!!!Does dialog1 open dialog2? If it does, try the following: 1. Give dialog2 a member variable - HWND m_hWnd1; 2. Before dialog1 opens dialog2 use - dialog2.m_hWnd1 = m_hWnd; Then use: RECT r; ::GetWindowRect(::GetDlgItem(m_hWnd1, IDC_HOLDER), &r);
-
Escape keyThanks alot! That's worked! - Gary.
-
Escape keyHi, I've noticed that the dialog-box programs I write using Visual C++ studio exit when the escape key is pressed. Does anyone know how I can stop this. Thanks - Gary.
-
Binary Data ManipulationSorry, I've corrected some things. int FindBit(BYTE* firstByte, int numBytes){ int pos = 0; int index = 0; BYTE current_bit = 1 << 7; while(index != numBytes){ if((firstByte[index] & current_bit) != 0) break; pos++; current_bit = current_bit >> 1; if(current_bit == 0){ current_bit = 1 << 7; index++; } } return pos; } NOTE: With your example, 00001101 10110101 10110101, this function would return a 4, because the count starts from zero. So if you want the count to start at 1, you'd have to add a 1 to the return value.
-
Binary Data ManipulationHi, This would work. int FindBit(BYTE* firstByte, int numBytes){ int pos = 0; int index = 0; BYTE current_bit = 1 << 8; while(index != numBytes){ if((firstByte[index] & current_bit) != 0) break; pos++; current_bit = current_bit >> 1; if(current_bit == 0){ current_bit = 1 << 8; index++; } } return pos; } NOTE: With your example, 00001101 10110101 10110101, this function would return a 4, because the count starts from zero. So if you want the count to start at 1, you'd have to add a 1 to the return value.