15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


LoadCursor Problem in Windows 95 / NT

Spencer Jones -- Spencer@azure.com
Wednesday, November 27, 1996

Environment: VC++ 4.2-flat, NT 4.0

I am developing using Windows NT for a Windows 95 application.
My problem is that I am using the function m_hCursor =
AfxGetApp()->LoadCursor( ID_MYCURSOR) in one of the views of my application,
and then SetCursor( m_hCursor ) in the OnMouseMove() function.

When running under NT this works fine, loading up the customised cursor. But
in windows 95 no cursor is loaded and the cursor is blank. I have placed an
ASSERT on the LoadCursor() to determine this is returning NULL in the 95
environment. As a test I have written a noddy application to do the above,
and it works fine, so it must be something in my application that is
upsetting the LoadCursor.

Does anybody have any clues where the problem may be, I have tried stripping
everything out of my application but it is still not loading the customised
cursor. A LoadStandardCursor DOES work!

General Architecture:

*	Multiple Doc interface. Disabling OnFileNew, to stop new documents being
loaded.
*	Three views, each built on a MultiDocTemplate
*	Each view has its own frame
*	included libraries are vfw32.lib, msacm32.lib
*	two views are based on CSrollView one is a CView, I have tried the code in
both view types
*	A modeless dialogue is loaded in the OnFileNew, for handling video frames.
*	The code has a splash screen, created from the component library.

CPreView::CPreView()
{
	m_hCursorZoom = AfxGetApp()->LoadCursor( IDC_ZOOMCURSOR );
	ASSERT (m_hCursorZoom != NULL);
	m_hCursorArrow = AfxGetApp()->LoadStandardCursor( IDC_ARROW );

	m_zoomMode = FALSE;
}

void CPreView::OnMouseMove(UINT nFlags, CPoint point) 
{
 	::SetCursor( m_zoomMode ? m_hCursorZoom : m_hCursorArrow );
	CScrollView::OnMouseMove(nFlags, point);
}

BOOL CPreView::Create( /*dumped stuff*/) 
{
	CString myClass = 
	AfxRegisterWndClass( 	0, 
				NULL,
				 (HBRUSH)::GetStockObject(WHITE_BRUSH), 
				AfxGetApp()->LoadStandardIcon( IDI_APPLICATION ) );
	
	return CWnd::Create(myClass, lpszWindowName, dwStyle, rect, pParentWnd, nID,
pContext);
}

Spencer Jones.
Azure Limited.	



Mario Contestabile -- Mario_Contestabile.UOS__MTL@UOSMTL2.universal.com
Friday, November 29, 1996

>When running under NT this works fine, loading up the customised cursor. But
>in windows 95 no cursor is loaded and the cursor is blank. I have placed an
>ASSERT on the LoadCursor() to determine this is returning NULL in the 95
>environment. As a test I have written a noddy application to do the above,
>and it works fine, so it must be something in my application that is
>upsetting the LoadCursor.
>
>void CPreView::OnMouseMove(UINT nFlags, CPoint point) 
>{
>  ::SetCursor( m_zoomMode ? m_hCursorZoom : m_hCursorArrow );

Did you try doing this in OnSetCursor()?

mcontest@universal.com






| Вернуться в корень Архива |