|
Hi,
In my (MFC) application, I would like to let the user configure his toolbars (add/remove buttons, associate custom bitmaps/commands with the buttons he adds). I have no idea as where to start. I know how to use a normal CToolBar , but with a fixed amount of buttons and an imagelist with the right size, and with the event handlers associated to each button. But how do we do that dynamically ?
~RaGE();
|
|
|
|
|
<thinking aloud>
I create a CToolBar object for each toolbar I want my user to customize. I have a .bmp where I stock every bitmap he may use to put on the button he wants to insert. For adding a button, I simply get the CToolBarCtrl control from the associated CToolBar and use the AddButton command.
Is this OK ?
I suppose that I need to map the IDs of the created buttons to commands, and that I will have to handle them in the OnCommand handler. Or is there any better way ?
</thinking aloud>
~RaGE();
-- modified at 15:22 Tuesday 18th April, 2006
|
|
|
|
|
I write a Application in form "Dialog" use menus.
I want to display "checked sign" when user click left mouse on that menu by using this code :
void CMTCaroDlg::OnUpdateOptionPlayoverlan(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(TRUE);
}
But when i run the Application, no thing to change !!!
Why ???
Help me please !!!
Lgx
|
|
|
|
|
this kind of handles are invalid for dialog.
u need to check it yourself by CheckMenuItem() function.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
|
How does use it ???
Help me please !!!
|
|
|
|
|
The update command UI system doesn't run for dialogs unless you add message handler for WM_KICKIDLE and start the update process from there. Google for WM_KICKIDLE and you should find many pages on what to do
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I am developing a directshow filter, but there is something wrong when running this filter. I know GraphEdit can be used to test the filter, but how to debug the filter step by step by setting breakpoint? Thanks.
|
|
|
|
|
Go to Project properties->Configuration Properties->Debugging in VS and set "Command" to the
path of your graphedit.exe. Then it starts automatically when you start debugging your filter.
In debugging mode you can step through your code by loading and starting your filter in graphedit, if you have properly registered the debug dll/ax with regsvr32.
|
|
|
|
|
Hello,
i want to display a long text (more than 127 characters) in the status bar. I am using GetStatusBarCtrl().SetText(...) but this function only displays 127 characters. I tried to display my text in two parts and then send it still using the previous function but didn't succeed (I get one part on the left and the other one completely on the right)
Thank you for your help,
agnes
|
|
|
|
|
Hi athomass
I'm not sure that this is your answer anyway use SetBorders in class statusbar
|
|
|
|
|
Hello,
Thank you for your answer, I tried that but I do not get what I want because I have to display other information on the right of the status bar (using SetPaneText and SetPaneInfo). If I use SetBorder, these information is also moved.
Somebody has another idea?
Agnes
|
|
|
|
|
I have given one big code with about 60 classes, and have been told that the code has memory leak, the code is compiled with visuall studio 6 and written in C/C++, does anybody know if the visual studio (any vresion) can find out where this emory leak would be located?
Thanks
nahi
|
|
|
|
|
Does it use MFC?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yes it does! it has a dll that would be used by another program and also VB and MFC for some other parts.
TNX
|
|
|
|
|
Then simply use F5 to start the program. Since it is a DLL, you'll need to provide the name of the EXE that goes with it. Any new without a matching delete will be noted in the Debug window when the program terminates.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
DEar David,
Thanks for the message, My program receives and sends out packets through sockets (put the info in some buff and sends them and kill the buff after sending out the info. What is your suggestion for me.
Best regards,
|
|
|
|
|
nahitan wrote: What is your suggestion for me.
See here. If you are saying that this will not work for you, how are you verifying that a memory leak exists?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
thanks for the help
|
|
|
|
|
I would say it is possible partially.
If its a simple memory leak wherein you have allocated a pointer and left it as it is you might be able to detect in VC++.
You can remove all the breakpoints. Run the code in Debug mode(press F5) -> run the application -> close it.
Your should be able to see straightforwards leaks in the output window of the VC++ application.
If you still cant detect then you might have to use external tools like boundschecker etc in the market to detect complex memory leaks.
|
|
|
|
|
As the code is not executable, and produces dll file, I was wondering if I could do what you suggested.
TNX
|
|
|
|
|
|
nahitan wrote: I have given one big code with about 60 classes, and have been told that the code has memory leak, the code is compiled with visuall studio 6 and written in C/C++, does anybody know if the visual studio (any vresion) can find out where this emory leak would be located? Thanks
try Rational Software, they have very power Performance tools
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
How can I hide the export information of my DLL, such as function name or class name?
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|