Click here to Skip to main content
15,889,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Determine when I am connected on LAN Pin
Ravi Bhavnani3-Oct-03 5:24
professionalRavi Bhavnani3-Oct-03 5:24 
GeneralRe: Determine when I am connected on LAN Pin
Alexander M.,3-Oct-03 7:42
Alexander M.,3-Oct-03 7:42 
GeneralRe: Determine when I am connected on LAN Pin
Alexander M.,3-Oct-03 7:41
Alexander M.,3-Oct-03 7:41 
GeneralRe: Determine when I am connected on LAN Pin
Alan Martinis3-Oct-03 7:45
Alan Martinis3-Oct-03 7:45 
GeneralRe: Determine when I am connected on LAN Pin
pma3-Oct-03 7:54
pma3-Oct-03 7:54 
GeneralRe: Determine when I am connected on LAN Pin
Alan Martinis3-Oct-03 8:07
Alan Martinis3-Oct-03 8:07 
GeneralRe: Determine when I am connected on LAN Pin
pma3-Oct-03 8:51
pma3-Oct-03 8:51 
GeneralClickable Bitmap UI question Pin
b_girl3-Oct-03 3:58
b_girl3-Oct-03 3:58 
In the interface I'm creating I have a dialog box that opens up containing a bitmap. Something different will happen depending on where on the bitmap the user clicks. I have 2 bitmaps, the "real" and the "template". I don't know why, but when the user clicks on the bitmap, the colour values are being read from the real bitmap and not the template one. I think the problem comes from this bit of code, but I'm not completely sure why:

in my constructor:
...
HBITMAP hTemplateBMP;
hTemplateBMP = ::LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PERIODIC_TMPL));
...

in my on clicked message handler:
POINT pt;
CDC *pDC = NULL;
CDC memDC;
HBITMAP hOldBMP = NULL;
COLORREF crColourAtPoint = 0;

GetCursorPos(&pt);
m_periodicBitmap.ScreenToClient(&pt);
pDC = m_periodicBitmap.GetDC();
memDC.CreateCompatibleDC(pDC);
hOldBMP = (HBITMAP)memDC.SelectObject(hTemplateBMP);
crColourAtPoint = GetPixel(memDC.m_hDC, pt.x, pt.y);
...

IDB_PERIODIC_TMPL is the template for my bitmap...

I believe crColourAtPoint ends up being the colour of the point in the real bitmap, not the template bitmap. Why??
GeneralRe: Clickable Bitmap UI question Pin
Jason Henderson3-Oct-03 5:12
Jason Henderson3-Oct-03 5:12 
GeneralRe: Clickable Bitmap UI question Pin
b_girl3-Oct-03 5:37
b_girl3-Oct-03 5:37 
GeneralRe: Clickable Bitmap UI question Pin
Jason Henderson3-Oct-03 5:45
Jason Henderson3-Oct-03 5:45 
GeneralRe: Clickable Bitmap UI question Pin
b_girl3-Oct-03 5:57
b_girl3-Oct-03 5:57 
GeneralRe: Clickable Bitmap UI question Pin
Jason Henderson3-Oct-03 6:01
Jason Henderson3-Oct-03 6:01 
GeneralRe: Clickable Bitmap UI question Pin
b_girl3-Oct-03 6:40
b_girl3-Oct-03 6:40 
GeneralRe: Clickable Bitmap UI question Pin
Jason Henderson3-Oct-03 6:44
Jason Henderson3-Oct-03 6:44 
GeneralRe: Clickable Bitmap UI question Pin
b_girl3-Oct-03 7:07
b_girl3-Oct-03 7:07 
GeneralRe: Clickable Bitmap UI question Pin
Terry O'Nolley3-Oct-03 8:57
Terry O'Nolley3-Oct-03 8:57 
GeneralRe: Clickable Bitmap UI question Pin
b_girl3-Oct-03 9:05
b_girl3-Oct-03 9:05 
QuestionHow to make a Dialog box Pop up on receiving a event Pin
Deepak Samuel3-Oct-03 3:12
Deepak Samuel3-Oct-03 3:12 
AnswerRe: How to make a Dialog box Pop up on receiving a event Pin
jmkhael3-Oct-03 3:18
jmkhael3-Oct-03 3:18 
AnswerRe: How to make a Dialog box Pop up on receiving a event Pin
David Crow3-Oct-03 7:22
David Crow3-Oct-03 7:22 
Generalconnect or disconnect ADSL Pin
Mnu3-Oct-03 2:01
Mnu3-Oct-03 2:01 
GeneralCouple question about Dialog in MFC Pin
NewHSKid3-Oct-03 1:35
NewHSKid3-Oct-03 1:35 
GeneralRe: Couple question about Dialog in MFC Pin
Jagadeesh VN3-Oct-03 1:58
Jagadeesh VN3-Oct-03 1:58 
GeneralB, I, U Pin
Florin Ochiana3-Oct-03 1:33
Florin Ochiana3-Oct-03 1:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.