|
how to use it.can you send me code snippet for it
|
|
|
|
|
Have a look at this [^] (MSDN).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
prathuraj wrote: SHBrowseForFolder
try wrapper for same http://www.codeproject.com/dialog/XBrowseForFolder.asp
|
|
|
|
|
how to expand tree view control to screen size?
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Since the tree view is a window, you can set its size calling SetWindowPos , see MSDN for details. Of course you have first to resize the tree view's parent window.
Hope that helps
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
i have to create a project similar to windows explorer using tree control. is there any sample projects for this
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Did you know that these forums are not the search facility on codeproject? If you try the automated search you will probably find it is quicker and (not meaning to insult anyone) may be more reliable that human memory.
When you do use the human search facility, please remember the results, as Bryce gave you the link to the tree control section on codeproject 2 days ago, which seems to have many suitable projects. Just to help:
Your previous posting[^]
Also, try exploring the neat little headings on the left panel of codeproject.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
sorry i didnt see the previous post reply i forgot my previous post
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
cp9876 wrote:
Also, try exploring the neat little headings on the left panel of codeproject.
good
|
|
|
|
|
deeps_cute wrote: how to expand tree view control to screen size?
GetWindowRect and MoveWindow will help!
|
|
|
|
|
Hello,
How can I properly create and use a CPropertySheet object with vertically arranged pages?
Here I've uploaded a demo project with source code included. It's just a simple SDI application which has main view class CVerticalPropSheetView (derived from CView) containing property sheet CPropSheetDemo (derived from CPropertySheet) with 3 property pages:
http://forum.codenet.ru/attachment....=1&d=1173007311
http://www.rsdn.ru:80/File/35531/VerticalPropSheet.rar
I tried to follow the advice from one of topics at CodeGuru forum (http://www.codeguru.com/forum/archi...p/t-331500.html) however, I've discovered the following issues related to resizing of the property sheet's window in CVerticalPropSheetView::OnSize():
1) When changing size of CPropSheetDemo window so that its width is less than its height, the tabs of the bottom property pages are not properly drawn. It looks like only rectangle part of property sheet (width x width) is being drawn properly.
2) When changing height of CPropertySheet window so that it can't display all tabs, the spin control is displayed. However, it doesn't work (I can't choose tab using spin control).
Does anyone know how to resolve these issues? All above appears only when property pages are arranged vertically - e.g. until I comment the following lines of code in CPropSheetDemo::OnInitDialog():
// create the new font for property pages' titles
CreateNewFont(&m_Font,14,_T("Microsoft Sans Serif"));
// make our property sheet vertical-oriented
CWnd* pctrlTab=GetDlgItem(AFX_IDC_TAB_CONTROL);
if (pctrlTab!=NULL) {
pctrlTab->ModifyStyle(TCS_FOCUSONBUTTONDOWN,TCS_VERTICAL,0);
pctrlTab->SetFont(&m_Font);
}
Many thanks in advance!
dp
|
|
|
|
|
Actually iam developing a custom active x control using PJsip stack for voip phone iin browser. First time it is working fine . but after we press Refresh button in browser IE is crashing. Actually iam unregistering the stack at the time of clicking refresh button . its showing an error in
TlsAlloc() in pjlib sorce.
Thanks in advance. pls give any suggestions regarding this.
Ranjith
|
|
|
|
|
tns_ranjith wrote: Actually iam unregistering the stack at the time of clicking refresh button . its showing an error in
when will you register it again!
|
|
|
|
|
Actually iam developing a custom active x control using PJsip stack for voip phone iin browser. First time it is working fine . but after we press Refresh button in browser IE is crashing. Actually iam unregistering the stack at the time of clicking refresh button . its showing an error in
TlsAlloc() in pjlib sorce.
Thanks in advance. pls give any suggestions regarding this.
Ranjit Kumar
|
|
|
|
|
tns_ranjith wrote: Thanks in advance. pls give any suggestions regarding this.
please don't post same question again and again... otherwise you will get flamed!...
|
|
|
|
|
i have to create dyanmic tab ie i have to increase the tab programmatically based on a falg. if flag = 3 then i have to create three tabs. how to do this. pls help me
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
Use CTabCtrl::InsertItem() function?
nave
|
|
|
|
|
ok how to prepare a dialog (separate page) for each dialog
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
You can use a property sheet for this
Follow the below path to add a property sheet
in the project menu->Add to project->Components and controls->Visual C++ Components->property sheet
nave
|
|
|
|
|
how to add property sheet dynamically
|
|
|
|
|
you can call AddPage() function of the CPropertySheet to add a tab
nave
|
|
|
|
|
This problem cropped up after I converted the dialog from modal to non-modal, so that might have something to do with it. The question: why should I have to call GetDlgItem to get a pointer to a dialog box control in every function instead of just once in OnInitDialog?
I've got these pointers in my modeless dialog box header file:
CListBox* ExpressionsListBoxPtr;
CListBox* FiltersListBoxPtr;
CListBox* TargetsListBoxPtr;
All were initialized to null by the constructor. In OnInitDialog() I put this (I checked to make shure OnInitDialog got called, and that the pointers were not null afterwords):
ExpressionsListBoxPtr = (CListBox*)(GetDlgItem(IDC_DLGS_EXPRESSIONLISTBOX));
FiltersListBoxPtr = (CListBox*)(GetDlgItem(IDC_DLGS_FILTERLISTBOX));
TargetsListBoxPtr = (CListBox*)(GetDlgItem(IDC_DLGS_TARGETLISTBOX));
The issue is that when I execute this fuction I get a debug assertation error and I've determined that the class level pointers are the source of the problem. I have worked around it by calling GetDlgItem in the function itself instead of just in OnInitDialog:
afx_msg void CRatiosNewSearchDialog::OnAddFilter()
{
CListBox* TempListBoxPtr = (CListBox*)(GetDlgItem(IDC_DLGS_EXPRESSIONLISTBOX));
int CurrentSelection = TempListBoxPtr->GetCurSel();
int Pos = 0;
CString Expression = "";
if(CurrentSelection == LB_ERR)
MessageBox("You must select an expression before you can add a filter. LB_ERR.", "User Error", MB_ICONHAND);
else
{
ExpressionsListBoxPtr->GetText(CurrentSelection, Expression);
Pos = Expression.Find(" - ", 0);
Expression.Delete(0, Pos + 3);
Pos = FiltersListBoxPtr->AddString(Expression);
ResetListboxScrollbar(FiltersListBoxPtr);
FiltersListBoxPtr->SetCurSel(Pos);
}
}
Can anyone tell me why it is not letting me just call GetDlgItem once when the dialog pops up instead of making me call it every time I want to use a control?
|
|
|
|
|
from MSDN
CWnd::GetDlgItem
Return Value
A pointer to the given control or child window. If no control with the integer ID given by the nID parameter exists, the value is NULL.
The returned pointer may be temporary and should not be stored for later use.
Why don't you simply associate control variables with your controls - i.e. associate a CListBox with IDC_DLGS_EXPRESSIONLISTBOX etc.
see: http://www.flounder.com/getdlgitem.htm[^]
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Thanks for the help. I got it working now...I just have to get rid of all of those GetDlgItem calls now. Guess I'll be using find and replace a lot too.
|
|
|
|
|
I should have explained the cause of the problem: Creating a listbox in the dialog creates a windows listbox (identified by a handle) but not any CWnd object. MFC overloads the GetDlgItem() to return a CWnd* so that you can use all the MFC CWnd:: functions, but as there is no CWnd object, it creates a temporary one which is cleaned up later in some idle processing time. I guess that your experience shows that this cleanup doesn't usually happen during DoModal(), but does if the dialog is run modeless.
What you could get and save is the HWND of each of your controls, this would stay valid for the lifetime of the dialog window. This is what you are essentially doing when you add a CListBox data member to your class and associate it with the particular windows control in the DoDataExchange() function. The HWND of the control is set in the DDX_Control() function from the ID you provide.
Adding these data members is automated (in VC6 use the class wizard, in VS2005 simply right click on the control in the dialog editor and select "Add Variable"). Then you have a CListBox that you can use in any member function once the dialog has been created.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|