|
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
|
|
|
|
|
tracking refers to dragging the edge of the window.
i think it harks back to the days when windows displayed a 'tracking rectangle' as you dragged instead of the dynamic resizing we get today.
|
|
|
|
|
Thanks. Next question. I set my max size hardcoded as
lpMMI->ptMaxTrackSize = CPoint(1228,872);
because thats what looks best on my machine. My XP resolution is 1280 by 1024 . If I maximise this app on a lower resolution machine, its going to go offscreen right? Or will it get as big as it can and stop there? If it goes offscreen I dont know how we'll get a hold of it to minimize it again (if the title bar is offscreen).
Should I not code this line?
Thanks,
ns
|
|
|
|
|
The max track size will only allow the window to be tracked to the maximum size that you set, or as far as the cursor can resize the window. Basically the max size is the minimum of what you specify, and the size of the screen that the window is running on.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
many thanks! So I'm in no danger with my hardcoding....
|
|
|
|