|
All my hidden toolbars are docked, if one is already docked, after the commands Print or Print Preview
Project MFC AppWizard(exe)
16 toolbars are created in the main frame, with code as follows,
if (!m_wndStiffenerBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | NULL | CBRS_TOP| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||!m_wndStiffenerBar.LoadToolBar(IDR_STIFFENER))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndStiffenerBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndStiffenerBar);
Like this toolbar, as shown above, all are initially hiddens
//Toolbars can be docked with menu command, as follows
void CMainFrame::OnMoveStiffener()
{
// TODO: Add your command handler code here
BOOL bVisible;
bVisible=((m_wndStiffenerBar.GetStyle() & WS_VISIBLE)!=0);
ShowControlBar(&m_wndStiffenerBar,!bVisible,FALSE);
RecalcLayout();
}
void CMainFrame::OnUpdateMoveStiffener(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(((m_wndStiffenerBar.GetStyle() & WS_VISIBLE)!=0));
}
The code is standard and works well but if a single toolbar is docked and if I give Print preview command, all the 16 toolbars, which I have created with similar code as above, are docked one below the other. If I hide all toolbar then this does not happen with Print command.
I will be grateful if you can help.
|
|
|
|
|
Hi all,
Use & with caption of controls in VC++2006, please tell me how can use it in VC++2005, becaoz i m using it but & with caption of control is not working in VC++2005.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi,
I need to make the desktop as parent for my dialog and it needs to be modal.can it be done?
Thanks
|
|
|
|
|
|
any sepcfic reason for doing it?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I am using a radio button of type int.
If it is type int how can I disable/enable and hide it.
If it is of CButton I can enable and disable it using GetDlgItem().EnableWindow.
I dont know how to do if it is of int type.
Thanks.
Regards,
Sunil Kumar
|
|
|
|
|
sunilkumar.d wrote: I am using a radio button of type int.
I didn't get that point.
sunilkumar.d wrote: If it is of CButton I can enable and disable it using GetDlgItem().EnableWindow.
You can disable radio buttons too by GetDlgItem().EnableWindow() . For instance,
GetDlgItem( IDC_RADIO1 )->EnableWindow( FALSE );
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
sunilkumar.d wrote: If it is type int how can I disable/enable and hide it.
If it is of CButton I can enable and disable it using GetDlgItem().EnableWindow.
Radio Button is a window you can still use GetDlgItem().EnableWindow, Radio Button is not int type; as MFC allows DDX_Radio function that manages the transfer of int data between a radio control group and a int data member of the parent class it seems to you that Radio button is of int type.
|
|
|
|
|
Are you at work on a Saturday? If yes, do you work on all Saturdays? Or are you at home, lazing around your computer with coffee and snacks? That rocks man... Me at office right now, with lots of work to be done. We have a release on Monday.
(On the brighter side of it, the work is interesting and that keeps me going. )
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
i tries to save my saturdays and sundays from work. wishes for successful release.
|
|
|
|
|
Thanks for the wishes man. I too try to separate work from my personal life. But, sometimes it just becomes impossible. [Me at office right now, am the only soul here, out of the 499 in this floor ]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi all,
i m new in database,i m using a SDI type appliaction in VC++ 2005, and MS-Access Datase through ODBC.
i m add class using MFC ODBC Consumer,and add desired database and its table for code.
By default it is derived from CRecordset. here GetDefaultConnect() for default connection and GetDefaultSQL() is present.
i want to know that in GetDefaultConnect() the connection string or path of database present, if i run my application on other computer then it gives an error, can i change the path in GetDefaultConnect(),
i dont knoe how can use it.
please tell me what string i pass in GetDefaultConnect() for execute my application properly for each computer.
Thanks in advance.
I m waiting for ur Valuable suggetions.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
If the connect string varies depending on location the app is running
from, then you need to provide the correct connect string instead of
hard-coding the string.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Please tell me with example.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
GetDefaultConnect() is virtual. Simply derive a class from CRecordset
and override GetDefaultConnect() to return an appropriate string.
That's great for one recordset, but it's much easier to manage connections
with CDatabase - the class that actually represents the database connection.
You can have multiple connections (CDatabase Objects) so you can pool connections.
CDatabase MyDatabase;
BOOL ret;
try
{
ret = MyDatabase.OpenEx(myconnectionstring, CDatabase::noOdbcDialog);
}
catch(CDBException *e)
{
return;
}
if (ret && MyDatabase.IsOpen())
{
CMyRecordset myRecordset(&MyDatabase);
...
Data Source (ODBC)[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
how can we create HBITMAP handle from device context
Trioum
|
|
|
|
|
|
Is there any differences?
And which should be better?
|
|
|
|
|
Hi all,
my prob is quite simple but i didn't foud how to do it.
I have a FormView and i wanna put a CView area into that one to draw things.
How could i do it ?
Thank ya
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
|
Is there a way to retreive the data entered in a Edit Control Box while using a numerical Type variable? I've seen lots of examples that retreive the data when the variable Type is a CString, but none when it is numerical. In my dialog box I've got a Edit Control Box and I've added a variable of integer type so the number entered could be retreived without doing a conversion. But the value is always zero no mater what is entered. The following is some of the code:
Edit_Numbers_Dlg::Edit_Numbers_Dlg(CWnd* pParent /*=NULL*/)
: CDialog(Edit_Numbers_Dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(Edit_Numbers_Dlg)
m_entered_number = 0;
//}}AFX_DATA_INIT
}
void Edit_Numbers_Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Edit_Numbers_Dlg)
DDX_Text(pDX, IDC_ENTERED_NUMBER_EDIT, m_entered_number);
DDV_MinMaxInt(pDX, m_entered_number, 0, 999999);
//}}AFX_DATA_MAP
}
void Edit_Numbers_Dlg::SearchNumbers()
{
for( int z=0; z<counter-1; z++="" )<br="" mode="hold"> {
if( oldnumbers[z] == m_entered_number )
found = 1;
}
}
|
|
|
|
|
hilop wrote: Is there a way to retreive the data entered in a Edit Control Box while using a numerical Type variable?
Yes. Use GetWindowText() , followed by atoi() .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Isn't GetWindowText() and atoi() for string types?
|
|
|
|
|
Edit controls contain only text, thus to get an integer you must get the text and convert it.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|