|
but i can't find the function WaitForSingleEvent?
thx
|
|
|
|
|
Ah. That's because I meant to type WaitForSingleObject instead.
Sorry about that, it's early in the morning here, and I didn't get much sleep.
Steve S
[This signature space available for rent]
|
|
|
|
|
thx, it is 100% new for me, but what does post a message mean?
post what messge? inside or outside loop?
please give me more details.
thx
includeh10
|
|
|
|
|
Posting a message at the end of a thread will update your primary thread on the status of the worker thread. For example, the message could trigger the primary thread to display the updated data. Furthermore, you should always post a message so that the primary thread can call closehandle() to ensure the thread is closed.
Kuphryn
|
|
|
|
|
returning from your Proc_Thread procedure automatically destroys the thread, without needing to send it any other message. A normal Proc_Thread has an event/message loop of the form :
BOOL bContinue = TRUE;
while ( bContinue )
{
switch( ::WaitForSingleObject( m_hComponentReadyEvent, m_WaitTime) )
{
case WAIT_OBJECT_0:
if ( !m_bShouldStopNow )
{
}
break ;
case (WAIT_OBJECT_0 + 1):
MSG msg ;
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
bContinue = FALSE ;
break ;
}
TranslateMessage(&msg);
DispatchMessage(&msg) ;
}
break ;
case WAIT_TIMEOUT:
if (m_bShouldStopNow)
bContinue=FALSE;
break ;
default:
break;
}
}
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
I have a problem...
When I am add some 'defines' in the 'resource.h' file, like
#define ID_BAND 110
...
and after that I try to open the class wizard, the class wizard put an error on the screen: "Parsing error: afx Message... input string: "LPTSTR MakeString(UINT..."
I searched and found out, that the following section in the 'MainFm.h' file producing the error:
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
LPTSTR MakeString(UINT stringID);
LPTSTR m_ToolTipsTable[NUM_TOOL_TIPS];
DECLARE_MESSAGE_MAP()
Can anyone help me??? (I use embedded Visual C++ 3.0)
--
Nice greets, Daniel.
|
|
|
|
|
All you need to do is to move the declarations of MakeString and m_ToolTipsTable outside the //{{AFX_MSG(CMainFrame) and //}}AFX_MSG block, so just before or just after is fine. The ClassWizard parses the code inside that block (among others), and it isn't able to cope that well with arbitrary declarations.
Steve S
[This signature space is available for rent]
|
|
|
|
|
Thanks!!!
--
Nice greets, Daniel.
|
|
|
|
|
How can I change the bitmap of a button in a CommandBand?
The images are stored in a image list.
I use embedded Visual C++ 3.0 with WinCE 3.0.
--
Nice greets, Daniel.
|
|
|
|
|
Hi all, I'm trying to use ShellExecute API to send email, but got some problems, the biggest one is that I don't know how to add line breaks into the email body, below are my code:
::ShellExecute(NULL,
"open",
"mailto:abc@def.com?subject=hello&body=hi,\nHow are you?",
NULL,
NULL,
SW_HIDE);
Everything went OK except the line break got eaten, I also tried "\n\r", no good either. Anyone know how to add line breaks? Thanks in advance.
Bin
|
|
|
|
|
You're probably better off just using MAPI. Do a search for MAPI here, there are a few nice articles / wrapper classes.
|
|
|
|
|
I tried those classes, they didn't work because my SMTP requires user authentication before sending messages(which SMTP does not nowadays?).
|
|
|
|
|
You'd need to url encode all the arguments sent to the mailto link.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
You've got to use %0D%0A instead or \r\n.
RFC 2368[^]
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
|
|
|
I am a jackaroo about C.
Thanks~
|
|
|
|
|
you can get MS's if you get a full version of Visual Studio.
or, you can just go get yourself a copy of gcc.
-c
"Half of the harm that is done in this world is due to people who want to feel important."
-- TS Elliot
|
|
|
|
|
im trying to serialize something but this works;
ar << m_bool;
and this doesn`t:
ar >> m_bool;
why?
|
|
|
|
|
i notice in "afx.h" that the CArchive class does not have an explicit override for '<< bool' so this may be the problem.
try casting it like this (as an experiment):
ar << (int)m_bool;
ar >> (int&)m_bool;
|
|
|
|
|
thanks it compiles just let me check if it works fine
|
|
|
|
|
As already explained, this was just an <i>experiment</i>.
For "the real stuff" you should provide your own streaming operators like:
CArchive& operator<<(CArchive&, bool);
CArchive& operator>>(CArchive&, bool&);
|
|
|
|
|
thanks i just did that.
|
|
|
|
|
From MSDN:
<code>ptMaxSize</code>
Specifies the maximized width (point.x) and the maximized height (point.y) of the window. For systems with multiple monitors, this refers to the primary monitor.
<code>ptMaxTrackSize </code>
Specifies the maximum tracking width (point.x) and the maximum tracking height (point.y) of the window. For systems with multiple monitors, this is the size for a window that is made as large as the virtual screen.
Whats tracking refer to ?
Thanks,
ns
|
|
|
|