473,414 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Cursor Desapearing


Dear all,
i have developed an application and the one thing that kept me busy i
the cursor.
From the MainFrm file i start an Interface Thread which is anothe
dialog. The thing is, before the dialog appearance, i connect to a
external database to get my data. Therefor the time between the butto
for starting the thread amd the appearance of the dialog is a bi
long.
I tried every way i could find on the web for showing the Hourglas
cursor while starting the thread and nothing worked.
It seams that when the code moves from the MainFrm to the Thread th
cursor changes.
_*CODE:*__
IN MAINFRM.H WHEN A BUTTON IS PRESSED
//Multithread
//
/****************************************/
//BeginWaitCursor();
//theApp.LoadCursor(IDC_WAIT);
//CWaitCursor wait;
/*****************************************/

if( pThread != NULL )
{
if (AfxIsValidAddress(pThread, sizeof(CWinThread)) &&
AfxIsValidAddress(pThread->m_pMainWnd, sizeof(CWnd)))
{
if (::IsWindow(pThread->m_pMainWnd->GetSafeHwnd()))
{
pThread->PostThreadMessage( WM_PCARDKILLTHREAD, 0, 0);
}
}
}
// OK, we need to create a new thread
pThread=AfxBeginThread( RUNTIME_CLASS(CPCardThread) );
IN THREAD STARTU
BOOL CPCardThread::InitInstance()
{
m_pMainWnd = &dlg;
CMRSApp* pApp = (CMRSApp*) AfxGetApp();
dlg.PRN = pApp->PRN;

dlg.DoModal();

return FALSE;
}

IN DIALOG STARTU
BOOL CPCardDlg::OnInitDialog()
{
CResizableDialog::OnInitDialog();

////////////////
//LOad Icon
////////////////
HICON hicon = AfxGetApp()->LoadIcon(IDI_NEWP);
ASSERT( hicon != NULL );
SetIcon( hicon, true );

////////////////
//Init Toolbar
////////////////
if( !m_wndToolBar.Create(this) || !m_wndToolBar.LoadToolBarEx
IDR_PCARD_TOOLBAR) )
{
TRACE("Cannot create toolbar!!!!\n");
EndDialog( IDCANCEL );
}

//Set buttons text
EkSetToolBarText( &m_wndToolBar, IDS_BUTTONS_TOOLBAR );
//Get windows version and load proper toolbar size
CMRSApp* pApp = (CMRSApp*) AfxGetApp();
if( strcmp( pApp->WinVer, "WinXP" ) == 0 )
m_wndToolBar.SetSizes( CSize(62, 62), CSize(32,32) );
else
m_wndToolBar.SetSizes( CSize(52, 52), CSize(32,32) );

CRect rcClientStart;
CRect rcClientNow;
Nov 17 '05 #1
0 901

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Brian Kelley | last post by:
I am trying to use threads and mysqldb to retrieve data from multiple asynchronous queries. My basic strategy is as follows, create two cursors, attach them to the appropriate databases and then...
2
by: dave | last post by:
In my form Ive got a SaveData() routine that saves changes to a DB. When I encounter an exception in the save operations, I am having trouble chaning the cursor back to the default cursor, it just...
5
by: Lespaul36 | last post by:
I have a mdi app. I need to change the cursor when I click on certain button on a form that I made into a toolbar. I tried to use cursor.current. But the cursor won't show. if I change the form...
10
by: Just Me | last post by:
Does Me.Cursor.Current=Cursors.WaitCursor set the current property of Me.Cursor to Cursors.WaitCursor And Me.Cursor.Current=Cursors.Default set the Me.Current property to something (default)...
2
by: Alex | last post by:
In the code below, clicking on the button ButtonChangeCursor changes the form's cursor to a WaitCursor. Clicking the button ButtonRestoreCursor changes the form's cursor back to its original...
2
by: Jim Frazer | last post by:
Hi, I'm working on an application in C# that will allow the user to create simple CAD drawings on a CEPC system. I would like to be able to change the cursor shape depending on the drawing mode...
7
by: Academic | last post by:
What are the different effects of the following two statements: C1.Cursor = Cursors.WaitCursor C1.Cursor.Current = Cursors.WaitCursor I believe the first replaces the entire C1.Cursor...
0
debasisdas
by: debasisdas | last post by:
RESTRICTIONS ON CURSOR VARIABLES ================================= Currently, cursor variables are subject to the following restrictions: Cannot declare cursor variables in a package spec. ...
4
by: mike | last post by:
I have the opportunity to rescue a project that uses a mouse to sense the relative position of a machine. The hardware is built...just needs to be programmed. Stop snickering!!! I didn't do it...I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.