![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Microsoft windows vista error all errors related to microsoft windows vista |
![]() |
|
DLL in C++ 6.0 does not work well under Vista
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Fixed Error!
Posts: 1,672
Join Date: Mar 2007
Rep Power: 3
IM:
|
the function of this DLL is to provide the user with an imagemap and allow them to graphically select a region, and then select details for that specific region. In Windows XP, this works fine, in Windows Vista it does not work at all and causes some serious issues with the program and painting on the Vista desktop. here is the mouse button event: void CGraphicCtrl::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default KillTimer(0); SetTimer(0, 750, NULL); ClientToScreen(&point); CBrush brushFill; COLORREF cRefFill; COLORREF cRefBackground; COLORREF cRefBlue = RGB(0, 0, 255); COLORREF cRefWhite = RGB(255,255,255); CClientDC dc(NULL); COLORREF cRefPixel = dc.GetPixel(point); if(!m_bDragPaint) { if(cRefPixel == cRefBlue) // if this region is already selected { cRefFill=cRefWhite; // fill it with white to deselect it cRefBackground=cRefBlue; } else if(cRefPixel == cRefWhite) // if this region is not already selected { cRefFill = cRefBlue; // fill it with blue to select it cRefBackground = cRefWhite; } else MessageBeep(0xFFFFFFFF); } else // m_bDragPaint == TRUE { cRefFill = cRefBlue; // fill all areas with blue to activate them cRefBackground = cRefWhite; } brushFill.CreateSolidBrush(cRefFill); dc.SelectObject(&brushFill); dc.ExtFloodFill(point.x, point.y , cRefBackground, FLOODFILLSURFACE ); #ifdef _DEBUG // PROGRAMMING: USE THIS TO FIND HOTSPOT FOR GRAPHIC CString strBuffer; strBuffer.Format("%i, %i\n", point.x, point.y); TRACE0(strBuffer); #endif if(!m_bDragPaint) { if( !m_iGroupMode ) { SetRegionAffected(dc); } else { SetGroupAffected(dc); m_iGroupMode=FALSE; } } ScreenToClient(&point); if((nFlags & MK_CONTROL) && m_bDebugMode) { CPoint pointLower(99999, 99999); CPoint pointUpper(-1, -1); CString strMessage; FindExtremeBounds(point - m_pt1, &pointUpper, &pointLower); strMessage.Format("Arbitrary point (%i, %i); Upper bounds (%i, %i); Lower bounds (%i, %i);", point.x - m_pt1.x, point.y - m_pt1.y + GetScrollPos(SB_VERT), pointUpper.x, pointUpper.y + GetScrollPos(SB_VERT), pointLower.x, pointLower.y + GetScrollPos(SB_VERT) ); MessageBox(strMessage); } COleControl::OnLButtonDown(nFlags, point); } |
|
|
|
|
|
|
|
|
#2 (permalink) |
|
Fixed Error!
Posts: 1,672
Join Date: Mar 2007
Rep Power: 3
IM:
|
You are calling the timer functions with a NULL argument where a HWND is required. Same applies to the CClientDC which normally takes a CWnd* as first pointer. I don't know whether it is the reason why it doesn't work on VISTA but itt is worth to firstly make it correct before looking further cause that isn't recommended for other Windows platforms either (even if it makes no problems there). |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|