|
humm, you might want to do subclassing.
-prakash
|
|
|
|
|
Yeah, that was something I hoped to avoid. I really would have thought there would be a way.
|
|
|
|
|
You have to catch WM_HSCROLL or WM_VSCROLL messages and in the WPARAM argument you can find SB_THUMBPOSITION or some other code depending on what the user is doing with the scroll bar.
|
|
|
|
|
The problem is WM_VSCROLL etc get sent to the richedit control, not my dialog. the winproc in my dialog I have to catch WM_COMMAND and in that wparam is EN_VSCROLL, and the lparam is the richedit handle, so I lose the SB_THUMBPOSITION and SB_BOTTOM etc.
If i subclassed the richedit and had a winproc for that i could get the WM_VSCROLL messages. but I did not want to sub class the richedit.
Thanks anyway
Luke
|
|
|
|
|
Well, I got it. If you add ENM_SCROLLEVENTS to the event mask, you will get the messages through WM_NOTIFY. Then the lParam is a pointer to a MSGFILTER stucture, which gives us the message code of original message, in this case WM_VSCROLL, and LOWORD(msgFilter->wparam) is the SB_*
N ow this is great. Only problem now is the mouse wheel does not fire this event, but it did fire the EN_VSCROLL through WM_COMMAND. annoying.
Thanks all
|
|
|
|
|
My bad, the wheel does fire the WM_VSCROLL through WM_NOTIFY. it did ever trigger the SB_ENDSCROLL which I was also testing for.
|
|
|
|
|
I write a record program ,But it's quality is very poor,What effect the
quality except the format
|
|
|
|
|
bit rate at which the recording was done,
for example 128 bps gives almost a CD-quality recording.
Other possible reason could be your hardware.
-prakash
|
|
|
|
|
Hi,
why is that some errors come in the release mode ,but not in debug mode ,like
Char ch[1];
then i try to copy the wholeno(1,2,....) into it ,it crashes in the release mode but not in the debug mode ,does it assign more space in the debug mode to the ch(in memory) more than told.
Regards
Farpointer
|
|
|
|
|
can you provide us with the copying code?
sometimes programming errors escapes in the debug mode and ideally there is no difference between the functionalit of debug and release apis.
-prakash
|
|
|
|
|
this[^] is a good resource too.
-prakash
|
|
|
|
|
thanx prakash it has wat i want
Regards
Farpointer
|
|
|
|
|
if you click print a document by Microsoft word,
I want to get the print message in my application,how to do that?
a hook can do that ?
thanks!
braden
-- modified at 21:40 Tuesday 1st November, 2005
|
|
|
|
|
This is my first time to post here. Here's my problem. I've written a code to modify my menu text from english to japanese. Translation of text was succesful but after the translation, the translated submenus were disabled. Anybody who got any idea on how I will solve this. Thanks in advanced.
|
|
|
|
|
Why is it getting disabled in the first place?
How does the chaging the text of the menu looks like?
-prakash
|
|
|
|
|
Thanks for the reply.
Here's what I did.
I don't have any idea why its getting disabled. It got disabled after translating the text from english to japanese.
First I open a text file which contains the original text and its translation.
The contents were read and was stored to a map(STL). I've also created a recursive function to traverse the menu and translate the text.
From that recursive function I get the submenus and the number of items under that submenus.
Here's the code:
void CTranslator::TranslateMenu(CMenu* pMenu, int MenuCount)
{
CMenu* SubMenu;
CString String;
char MenuString[50];
int SubMenuCount = 0;
int Index = 0;
do // while (MenuCount != Index)
{
ZeroMemory(MenuString, 50);
pMenu->GetMenuString( Index, MenuString, 50, MF_BYPOSITION);
String.Format ("%s", MenuString);
if(! String.IsEmpty())
{
pMenu->ModifyMenu(Index, MF_BYPOSITION, MF_POPUP, GetTranslation( String ) );
}
SubMenu = pMenu->GetSubMenu(Index);
if(NULL != SubMenu)
{
SubMenuCount = SubMenu->GetMenuItemCount ();
TranslateMenu(SubMenu, SubMenuCount);
}// if(NULL != SubMenu)
pMenu->EnableMenuItem (Index, MF_ENABLED);
Index++;
}while (MenuCount != Index);
}// CTranslator::TranslateMenu(CMenu *pMenu)
|
|
|
|
|
romuzu wrote: pMenu->EnableMenuItem (Index, MF_ENABLED);
try pMenu->EnableMenuItem (Index,MF_BYPOSITION | MF_ENABLED);
-prakash
|
|
|
|
|
Thanks for the reply.
I did that before but still did not enable the menu.
|
|
|
|
|
romuzu wrote: pMenu->ModifyMenu(Index, MF_BYPOSITION, MF_POPUP, GetTranslation( String ) );
I could not understand this function call and does not fit in any of the sig provided
did you mean
pMenu->ModifyMenu(Index, MF_BYPOSITION | MF_STRING,, GetTranslation( String ) );
-prakash
|
|
|
|
|
I have got so many classes in my VC++ project that I feel they are very complicated. so I want to illustrate their relationship clearly with UML. is there any software can be used to draw a diagram of the relationship of these classes for me?
or, is there any other way to do this?
thank you very much!
-------------------
I am learning C++ and English
|
|
|
|
|
|
for the moment I have no RationalRose, can I use the Microsoft Visual Modeler instead, which, you know, is a tool in the visual studio?
-------------------
I am learning C++ and English
|
|
|
|
|
I dont know much about visual modeler, I know that in RationalRose you can import the C++ files and it generates the UML which you can straighten up.
You can download the evaulation version and see if it meets your requirement.
-prakash
|
|
|
|
|
thank you very much
-------------------
I am learning C++ and English
|
|
|
|
|
I usally use 'malloc' and 'new' to allocate memory.
And I know 'free' or 'delete' should follow them.
If I forgot to release the allocated momory, I could see
a warning message (like below) for memory leak
which is displayed by MFC Tracer.
[2872] Detected memory leaks!
[2872] Dumping objects ->
[2872] G:\WORK\CaptureManager.cpp(211) :
[2872] {320}
[2872] normal block at 0x003775D8, 4 bytes long.
[2872] Data: < > CD CD CD CD
[2872] Object dump complete.
However, in some codes, LocalAlloc is used instead.
Even though LocalFree is not called to free memory,
warning message wouldn't appear.
I wonder if LocalAlloc doesn't need LocalFree,
and memory leak warning message from MFC Tracer is unreliable.
any idea is welcomed,thanks
|
|
|
|