|
Hi,
If your using VS 2005 I would advise the following:
<br />
Namespace: System.Windows.Forms<br />
Assembly: System.Windows.Forms (in system.windows.forms.dll)<br />
<br />
Cursors::Default;<br />
Cursors::Hand;<br />
Cursors::HourGlass;<br />
else try this:
<br />
<br />
void LengthyFunction( )<br />
{<br />
<br />
CWaitCursor wait;
<br />
<br />
}
<br />
<br />
void ConditionalFunction( )<br />
{<br />
if ( SomeCondition )<br />
{<br />
CWaitCursor wait;
<br />
<br />
}
else<br />
{<br />
}<br />
}<br />
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
I try thease code.
it don't work..
void CThread1Dlg::OnOK()
{
AfxBeginThread(Thread,this);
}
UINT Thread(LPVOID pParam)
{
CWaitCursor wait;
CThread1Dlg *m_dlg = (CThread1Dlg*)pParam;
for (int i=0;i<200;i++)
{
Sleep(20);
}
TRACE("Finish");
return TRUE;
}
|
|
|
|
|
Max++ wrote: it don't work..
Which tells us a whole lot.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
As you've discovered, CWairCursor won't work in a separate thread.
If you look at CWaitCursor, all it does is call SetCursor, and then restore your old one when its destructor is called.
If its in the same thread as the message pump (99.(% the main thread), then no messages are processed, including WM_MOUSEMOVE & WM_SETCURSOR.
If its in a separate thread, then the first time WM_SETCURSOR is processed, your cursor will be reset.
The solution is to override WM_SETCURSOR / OnSetCursor in your main program, or view (as appropriate).
BOOL CMyWndOrView::OnSetCursor (HITTYPE ht, CPoint pt)
{
if (ht == HTCLIENT && m_bMyThreadIsActive)
{
SetCursor (m_hMyThreadyCursor)
return TRUE;
}
else
return CWndParentClass:OnSetCursor (ht, pt);
}
This is off the top of my head - check the function prototype using MSDN, and you may also need to create the window class using a NULL cursor. See OnPreCreateWindow for MFC.
I hope this guides you in the right direction....
Iain.
|
|
|
|
|
I'm currently using a dialog based application. May i know how do i open a file or link to the file by just selecting one of the items listed in the combo box?
For example, my program is to test IC. The combo box will contain different type of IC. Therefore, by choosing one of the items listed in the combo box, i will be able to send appropriate data to the hardware to do the testing process. So, is there anyone who may advice me on how to link the appropriate file corresponding to the chosen item in the combo box?
Thanks.
|
|
|
|
|
Hi,
Have you tried using the onclick event of the combo box? (I'm assuming you are using VS 2005).
Hope this might help you
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
i'm using visual studio 6.0. Do you know any related examples i can refer to.
thanks in advance
|
|
|
|
|
Are you handling the CBN_SELCHANGE notification? If so, in that handler function, use the GetCurSel() and GetLBText() methods.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Do you have any related examples that i can refer to. I'm still a beginner at this. so if yes, thanks alot
|
|
|
|
|
Use ClassWizard (Ctrl+W) to create a handler function for the CBN_SELCHANGE notification. In that handler function, call GetCurSel() and GetLBText() , like:
void MyDialog::OnSelChange()
{
int nIndex;
CString strText;
nIndex = m_combo.GetCurSel();
m_combo.GetLBText(nIndex, strText);
}
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
this doesn't mean anything. a combo box contains strings only, so when the Combo is populated, you have to store the source list, to recall the data selected later...
|
|
|
|
|
CBN_SELENDOK is the notification you want to be looking for. It is sent when the user selects and item, and confirms the selection. Do not respond to CBN_SELCHANGE because the user can select items and not confirm the selection (e.g. drop down the box, mouse over items to select them, and then press <esc> to cancel).
What you need to do after determining the user's action is another thing...
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Do you know any related examples i can refer to? if yes, it would be great. i'm a beginner at this. thanks
|
|
|
|
|
Do you have any related examples that i can refer to. I'm still a beginner at this. so if yes, thanks alot
|
|
|
|
|
After declare CBN_SELCHANGE and get string of combobx you need to path of this string
|
|
|
|
|
We usually assign String value to an ID in the String table. e.g.
**************************************************
STRINGTABLE
BEGIN
IDS_ABOUTBOX "&About..."
IDS_VALUE "Value"
END
**************************************************
We use LoadString() method to retrive the value of IDS_VALUE.
However, how can we allocate a new value to IDS_VALUE in the code side? maybe "New Value"
thx!
Skytear
|
|
|
|
|
xiaoke wrote: However, how can we allocate a new value to IDS_VALUE in the code side? maybe "New Value"
Either change the .rc file and recompile, or use BeginUpdateResource() and UpdateResource() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Ok,
After googling my brains out, asking all my friends on ICR, Yahoo, AIM, and MSN/Live!, I stand corrected when i say "If you know how to use good keywords, you can find anything on google". I know in VB6, the MS-Winsock ActiveX control can become an array item simple by making
Winsock_Control.Index = 0
but i'm a Newb to networking in C++, and after reading a million articles, still have no clue how to make an array of sockets, or how to respond to incomming data from each one, without writing a seperat function for each one. i managed to get 1 to work after reading an article i found here on the site ( HUGE thanks to the author of "Programming TCP.doc" ) but, now i am left with the question, and a handful of hair...where are the arrays?? either a snippit of code, or a link to a good article would truely make my day
**PPPSHT** ACA Over And Out....*PSSHHT* 10/4 ACA
One day all military forces will be robotic, and you will know the ones programmed in VB, because they will appear to have downsyndrome - Inetd.Conf
|
|
|
|
|
i opend the harddisk like this
sHardDisk.Format("\\\\.\\PhysicalDrive1");
HANDLE hDevice = CreateFile(sHardDisk,GENERIC_READ,......,0,OPEN_EXISTING,0,0);
then i read the Partition table using ReadFile
Everything is fine i can read all the partitions and extended partitions directly from harddisk but my questions is
How can i find out the logical drive name corresponding to the Partitions and extended
partitions that i read directly from hard disk?
Thank you in advance.
To err is human, to blame it on somebody else shows management potential.
|
|
|
|
|
Hi,
Are you talking about something like this [^] ?
-----------
Mila
|
|
|
|
|
You got me curious now whats the difference between
"\\Device\\HarddiskVolume1" and "\\\\.\\PhysicalDrive1" i suspect one is a logical drive and the other is a device.
what i am doing is opening the harddisk reading directly from the sectors and loading the partition table and then reading the MFT.
I dislike feeling at home when i am abroad.
To all the virgins in the world thanks for Nothing.
|
|
|
|
|
hi all
i'm developping an application wich use a lot of xml documents...i want to parse a file xml, but i didn't find any function or Api to do it..
can you help me please...
thanks
|
|
|
|
|
You can use TinyXML[^] for this purpose. It's a nice cross-platform XML parser.
|
|
|
|
|
it's ok..thanks a lot
(merci beaucoup:->)
|
|
|
|
|
Depending on the features you want in a parser, there is Xerces/Xalan (which you can get off of www.apache.org), MSXML (which comes with Windows -- very similar API to Xerces), and TinyXML.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|