|
Buttons need to capture the mouse in order to know when the user has released the mouse button so that it can know when to act, and how to draw itself (i.e. pressed or not). If your tabs are not acting as real buttons, there is no need for the tab control to know when the mouse was released.
That is my take on it...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> 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! See DeleteFXPFiles
|
|
|
|
|
I am aggree with your answer.
But its not given in MSDN that WM_RELEASEDCAPTURE will be fired only when TCS_BUTTONS style is set. Why is it so?
Can you tell me from where I can get more information on this point?
If its given in MSDN it will be more helpful for me.
|
|
|
|
|
Hi All,
Please help me with these,
I need to know the C++/COM (both included) datatypes that can hold the following types of numbers.
1. Packed BCD --> What datatype can be used to hold these numbers.
2. Packed HEX --> What datatype can be used to hold these numbers.
Please excuse if the Q's are silly, but it will be of great help if i get the answers.
Thanks & Regards,
Dhana
|
|
|
|
|
Unpack them, and use native types.
There are no "native" packed BCD/HEX types that I know of for either C++ or automation types.
I would unpack them in order to pass them across COM boundaries using automation-capable types, like double (VT_R8 ), and int (VT_I4 ).
If you really need to perserve the native binary data, you can allocate a BSTR using SysAllocStringByteLen(...) and stuff the binary data into the allocated memory. This is generally not something for the faint-of-heart, however...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> 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! See DeleteFXPFiles
|
|
|
|
|
Hi all,
After creating a thread:
HANDLE handle;
handle = (HANDLE) _beginthread( ThreadProc,0,&val);
Is it possible to pause the thread or put it in a standby mode?
Thanxs
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Of course. See the SuspendThread(...) function.
Edit -- If you are trying to selectively wake the thread up on certain events, create Win32 Event objects, and have the thread wait on them by using functions like WaitForSingleObject(...)/WaitForMultipleObjects(...) .
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> 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! See DeleteFXPFiles
|
|
|
|
|
Hi, thanx alot James
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: Is it possible to pause the thread or put it in a standby mode
Yes it is. You can use events:
<br />
HANDLE CreateEvent(<br />
<br />
LPSECURITY_ATTRIBUTES lpEventAttributes,
BOOL bManualReset,
BOOL bInitialState,
LPCTSTR lpName
);<br />
<br />
<br />
BOOL SetEvent(<br />
<br />
HANDLE hEvent
);<br />
<br />
<br />
BOOL ResetEvent(<br />
<br />
HANDLE hEvent
); <br />
<br />
<br />
<br />
<br />
<br />
DWORD WaitForSingleObject(<br />
<br />
HANDLE hHandle,
DWORD dwMilliseconds
);
You can also use these functions:
<br />
DWORD SuspendThread(<br />
<br />
HANDLE hThread
);<br />
<br />
<br />
<br />
DWORD ResumeThread(<br />
<br />
HANDLE hThread
); <br />
Also Creating critical sections suspends threads when they are trying to use same datas as other threads which are using it in the same time.
|
|
|
|
|
Hi, thanx alot newbie .... I think you can upgrade your screen name to not_a_newbie_any_more
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: Is it possible to pause the thread or put it in a standby mode?
Along with what others said...
Use _beginthreadex as you can also specify a flag CREATE_SUSPEND which creates the thread in suspended mode.
|
|
|
|
|
excelent answer... and shame on me
thanks mate
|
|
|
|
|
super_ttd wrote: and shame on me
Why! Nothing to feel ashamed of.
|
|
|
|
|
thanks Nibu Babu Thomas
i tried it at home yesterday evening, and effectively, that's working as expected.
i have a subsidiary question. do you know how I could bold the MenuItem in a PopupMenu created with the following :
void CtestDlg::OnPopupMenu()
{
CMenu popup;
if (popup.CreatePopupMenu())
{
popup.AppendMenu(MF_STRING, 1, "Test Titre");
popup.AppendMenu(MF_SEPARATOR);
popup.AppendMenu(MF_STRING, 10, "menuItem1");
popup.AppendMenu(MF_STRING, 11, "menuItem2");
popup.AppendMenu(MF_STRING, 12, "menuItem3");
popup.EnableMenuItem(1, MF_GRAYED);
CRect rect;
m_popupMenu.GetWindowRect(&rect);
popup.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, rect.right+1, rect.top, AfxGetMainWnd());
popup.DestroyMenu();
}
}
|
|
|
|
|
super_ttd wrote: i have a subsidiary question. do you know how I could bold the MenuItem in a PopupMenu created with the following :
I don't think you can set menu item font to bold. Of course you can make an item as default which will in turn make that menu item a bold one.
It's a bad practice to set all menu items to bold. As per convention only a default menu item should have bold typeface.
Default menu font's are managed by windows itself. We can't do and we should not interfere with this process.
If it's a must for you to do this then create custom menu completely different from existing menu provided by windows as Microsoft office and visual studio has done.
|
|
|
|
|
hum, i didn't know about default menu items. i'll try that.
actually, what i have is a button, which pops up a popupMenu next to it when clicked.
On this menu, the first element is the name of the current application (grayed BTW), and the second element is a separator. only then follow the really clickable items.
I would like now to bolden the application title, but as you can understand, it will not be clickable, because grayed.
i don't know if setting it as the default item will work anyway, but i'll give it a try and i'll tell you.
thanks for your input dear.
|
|
|
|
|
super_ttd wrote: actually, what i have is a button, which pops up a popupMenu next to it when clicked.
On this menu, the first element is the name of the current application (grayed BTW), and the second element is a separator. only then follow the really clickable items.
I would like now to bolden the application title, but as you can understand, it will not be clickable, because grayed.
i don't know if setting it as the default item will work anyway, but i'll give it a try and i'll tell you.
Try this[^] article. I use this quite often.
|
|
|
|
|
Hi All,
i have a button "DISABLE", BUT i want to know when the user click it... is possible??
thanks in advanced
Raiz
|
|
|
|
|
Ing.Raiz82 wrote: is possible??
No.
|
|
|
|
|
Do you want to know if the user tried to activate the disabled button? If so, trap mouse messages like WM_MOUSEMOVE and WM_LBUTTONUP (not WM_LBUTTONDOWN - normal buttons activate on the release of the mouse button).
If you are worried about some other application sending you artificial button click messages (like the application that automatically dismisses the Outlook "something is trying to send email on your behalf" dialog), look for WM_COMMAND messages for that button, and if you know button's state when you last set it, you can determine if the message is real or not.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> 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! See DeleteFXPFiles
|
|
|
|
|
thanks
... is a good idea...
now i try....
thanks
Raiz
|
|
|
|
|
Hi,
i create a Frame within a TabWnd. In the different Tabs, i place a View.
If i click on button on the view, i create dynammicaly a new View and replace it.
If the user wishes to close this new View, the old view returns.
The changing works nice, but i have trouble to close and delete the view.
I send a WM_CLOSE to the view and after this a delete :
LRESULT ViewTabWnd::CloseOld(WPARAM w, LPARAM l)
{
CWnd* Old = (CWnd*)w;
Old->SendMessage(WM_CLOSE);
delete Old;
return TRUE;
}
But at "delete Old" i have the error :
Last Trace : (<<<<<<< indicates the debug-trace )
void PASCAL CObject::operator delete(void* p)
{
#ifdef _AFX_NO_DEBUG_CRT
free(p);
#else
_free_dbg(p, _AFX_CLIENT_BLOCK); <<<<<<<<<
#endif
}
if (pHead->nBlockUse == _IGNORE_BLOCK)
{
_ASSERTE(pHead->nLine == IGNORE_LINE && pHead->lRequest == IGNORE_REQ);
/* fill the entire block including header with dead-land-fill */
memset(pHead, _bDeadLandFill,
sizeof(_CrtMemBlockHeader) + pHead->nDataSize + nNoMansLandSize);
_free_base(pHead); <<<<<<<<<<<<<<<<<
RTCCALLBACK(_RTC_FuncCheckSet_hook,(1));
return;
}
Does anyone knows this problem ?
I'm confused
Thanks
|
|
|
|
|
Looks like pointer you are deleting is already deleted and dangled .
baerten wrote: LRESULT ViewTabWnd::CloseOld(WPARAM w, LPARAM l)
How this message/function is called ?
|
|
|
|
|
thanks
via a PostMessage
LRESULT ViewTabWnd::CloseOld(WPARAM w, LPARAM l)
{
CWnd* Old = (CWnd*)w;
Old->SendMessage(WM_CLOSE);
delete Old; << I step here, then via F10 i step into the destructor and then the error is launched
return TRUE; << i never step here
}
|
|
|
|
|
I found the error ...
It's a variable which has a wrong syntax, i wrote bool at place of BOOL
5 hours of recherche for nothing
Thanks anyway
|
|
|
|
|
baerten wrote: It's a variable which has a wrong syntax, i wrote bool at place of BOOL
Nice to see, your error is solved.
But, really cant understand how it affects your code. Can you show changes , you needed to make.
|
|
|
|