|
Then i expect you will have to manually add/delete buttons after you create the toolbar from the resource. Once deleted the buttons should not show in either the left or right cutomization lists.
The problem is you are trying to impliment 2-level customization support and the built-in toolbar customization only supports 1-level. You will have to code the wrapping customization level.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
cmk wrote:
you will have to manually add/delete buttons after you create the toolbar from the resource
Ah Ha! Yes, this is what I had been trying to do, but DeleteButton didn't appear to work for me.
I went back to try again, and I now realize my mistake. HideButton takes a command ID to hide, but DeleteButton takes an index (which you have to get by using CommandToIndex). I had been calling DeleteButton with a command ID. Now I can delete the unnecessary buttons at startup, once I've determined the configuration I need.
I knew there had to be an easy answer.
Thanks very much for your help!
Cheers - Sean
|
|
|
|
|
Well, not quite.
DeleteButton (with index) does delete the button from the toolbar, so it no longer shows up in the right-side list of the customize dialog (like it did when the button was hidden), but it DOES still appear in the left-side (available list).
Doh!
Is there another way to delete/remove the button from the CToolBarCtrl after it has been loaded from the resource?
Thanks again,
Sean
|
|
|
|
|
Okay, finally got it.
When populating the customize dialog, there are messages handled by OnGetButtonInfo. In the handler, I can test for the "forbidden" command ID's, and set the button state to TBSTATE_HIDDEN for those buttons. Now the buttons don't even show up in the available list.
Thanks again (and sorry for being such a dutz!)
Cheers - Sean
|
|
|
|
|
Hallo,
In MFC, I create owner draw buttons(CBitmapbutton class)and i want to hold the button pressed and it should do some action. I tried with the following code:
void userdefined::OnLButtonDown(UINT nFlags, CPoint point)
{
if(m_left.PtInRect(point))
{
AfxMessageBox("its working");
}
CDialog::OnLButtonDown(nFlags, point);
}
In the initdialog, I give the button's CRect parameters to the CRect m_left;..
I tried a lot.. & I really need your help guys ...
thanx in advance ..
kingsly
Assariah Kingsly
Masters in IAE (Bremen,Germany)
Basic VC++ programmer.
|
|
|
|
|
Assariah kingsly wrote:
i want to hold the button pressed and it should do some action.
See this[^] or this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanky ravi for your reply ..
i tried the same code with a new project .. i have the same errors as i get before.. may be i may week in some basic concept i dont know ...
my errors are
f:\terrain\check\checkdlg.h(23) : error C2146: syntax error : missing ';' before identifier 'm_button1'
f:\terrain\check\checkdlg.h(23) : error C2501: 'CAutoRepeat' : missing storage-class or type specifiers
f:\terrain\check\checkdlg.h(23) : error C2501: 'm_button1' : missing storage-class or type specifiers
checkDlg.cpp
f:\terrain\check\checkdlg.h(23) : error C2146: syntax error : missing ';' before identifier 'm_button1'
f:\terrain\check\checkdlg.h(23) : error C2501: 'CAutoRepeat' : missing storage-class or type specifiers
f:\terrain\check\checkdlg.h(23) : error C2501: 'm_button1' : missing storage-class or type specifiers
F:\Terrain\check\checkDlg.cpp(77) : error C2065: 'm_button1' : undeclared identifier
Generating Code...
Error executing cl.exe.
check.exe - 7 error(s), 0 warning(s)
I know there is a small problem but i am really not able to figure it out..
please help me in this regard..
thanx in advance .
mfg,
kingsly
|
|
|
|
|
It's hard to know what's wrong without looking at your source code. If I were to hazard a guess, I'd say you probably forgot to #include the file containing the definition for CAutoRepeat .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I add a new Win32 Application project, how can I use MFC in this project ? What files will I need to include ?
Thanks in advance.
|
|
|
|
|
Did you create it via AppWizard, or are you trying to retrofit an existing Win32 application to use MFC?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Yes, I create it via AppWizard. What files will I need to include to use MFC in current project ?
Thanks in advance.
|
|
|
|
|
When creating a Win32 Console Application project, step 1 of AppWizard asks if it supports MFC. There is no such option when creating a Win32 Application project. I would suggest creating a new MFC AppWizard (exe) project.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
When I build my project, I receive this error :
--------------------Configuration: Thread3 - Win32 Debug--------------------
Compiling resources...
K:\Thread3\Thread3.rc (146): error RC2104 : undefined keyword or key name: IDC_STATIC
Error executing rc.exe.
Thread3.exe - 1 error(s), 0 warning(s)
What is error IDC_STATIC ?
Thank you.
|
|
|
|
|
microsoftcertificate wrote:
What is error IDC_STATIC ?
It's defined as -1 in afxres.h .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I did not modify it, but while it appeared this error ?
Thanks in advance.
|
|
|
|
|
I would hazards a guess and say that something in the project's .rc file, most likely a dialog template, was changed. Search the project's .cpp, .h, and .rc files to find references to it.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Can somebody tell me the difference between ON_NOTIFY and ON_NOTIFY_REFLECT messages and how to handle them...?
any information would be highly appreciated..
thanks
|
|
|
|
|
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
hi david...
thanks for the information...it helped a lot..
i would be really grateful if u can throw some light on the arguments passed to these ON_NoTIFY and ON_NOTIFY_REFLECT functions..
eg. NMHDR* pNMHDR, LRESULT* pResult
do i have to set LResult in my handles code....i am not clear about the LRESULT paramaeter..what does it stand for?????
thanks in advance
nitin
|
|
|
|
|
Read here and here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
i am making a client server application in which client will call system calls and send the information to server.
I want to store that information into database e.g Access using ADO.
Plz guide me what should i do?
Do i have to do serialization of data?
e.g From client i have to send the the computer name and user name to server. how will i do this ?
how will i serialize data?
how will i use ADO? I am newbie plz be aptient with me and also tell me examples as well
Thanks a lot
|
|
|
|
|
|
|
Is there a way to use cout<< or something like it without including iostream. I have a simple app with one cout statement and no inputs. The file is 5k without iostream included, but 260k with it.
Regards
Paul
|
|
|
|
|
use printf();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|