|
Here it is.
CString csTreeItem = m_ObjTree.GetItemText(m_ObjTree.GetSelectedItem());
CString csComboItem;
for( int nInd =0; nInd < m_ObjCombo.GetCount(); nInd++ )
{
ObjCombo.GetLBText(nInd, csComboItem);
if( 0 == csComboItem.compare(csTreeItem ))
{
ObjCombo.SetCurSel(nInd );
break;
}
}
|
|
|
|
|
Thanks for ur reply..
Acccording to ur way as per my understanding my combobox should have the selected item from the treectrl in its datalist ,and then comparing it with the one selected , it is updating in comboboox.
But if i have the simple combbox datalist which just have the datlist items like C:\ ,D:\ not the whole contents of the drives ... in such sitution do we manage it ???
Thanks
Saniaa
|
|
|
|
|
Sorry. I don't get ur need clearly.
if the selected tree control item not in ur combo box,
You want to add it in the combo and select that one?? or map to any other item??
|
|
|
|
|
Hi,
I'm not sure ... you've got a combobox only with drive letters and on treectrl full path, and when you select some path on tree, in combobox should appear full path ?
If yes:
- HTREEITEM GetSelectedItem() - you'll get selected item handle
- CString GetItemText( HTREEITEM hItem ) - you'll get item text
- HTREEITEM GetParentItem( HTREEITEM hItem ) - you'll get parents' item handle
- CString GetItemText( HTREEITEM hItem ) - you'll get item text
...
unless your parents' item handle will equal with root
- HTREEITEM GetRootItem( )
when you'll get all path, you can send all text to combobox
- int InsertString( int nIndex, LPCTSTR lpszString )
and select
- int SetCurSel( int nSelect );
-----------
Mila
|
|
|
|
|
Do you select an item on treectrl and you want to compare it with item on combobox
|
|
|
|
|
Combobox is not having the item which got selected in the treectrl .so my requiremant is that, as the treectrl item get selected or get changed the combobox should show the current path of the item(which got selected on the treectrl) in its editbox.Is it possible..?and How ?
God hepls those who hepls themselves ....
Thanks in advance
Saniaa
|
|
|
|
|
You select an item on treectrl and now you want to display this item on ComboBox(edit),Right?
|
|
|
|
|
Hi,
Can we send the pixel coordinates into MS Paint and display the pixel in MS Paint through VC++.
Kiruba
|
|
|
|
|
Hello
You can not modify the behavior of MS paint . Microsoft is the owner !!!!!!
If possible try to get the source code of MS paint
redindian
|
|
|
|
|
Link error:
Linking...
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class
std::allocator<char> >::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >(class
std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> > const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) already defined in rts_scene_area.obj
msvcprt.lib(MSVCP71.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char="">,class
I ignore msvcprt.lib,the error still exist.
Runtime libaray is Multi-threaded (/MT),Boost library is included to identify point.
-- modified at 0:50 Friday 3rd November, 2006
|
|
|
|
|
silly question, but mabey you only have it ignored for debug mode but not release mode. Are you ignoring it in release mode as well?
|
|
|
|
|
|
See here[^]
maybe it is some helpful for you
|
|
|
|
|
Hi,
I intend to integrate the functionality of two dlls into one by means of merging the code. I'm adopting the following steps.
1) Create a master framework for the merged entity say dll A.
2) Include all the files that are distinct for the two dlls(B & C) into the project created for dll A.
3) For all the files that are same in dll B and C, include a single file into the merged entity and into that file put all the functions that are distinct in the file under B and C.
I think this should suffice. Please correct if there is something to be done
The problem comes for functions that are same in the common file.
Say in dll B We have a function like
class B : function()
{
}
Say in dll C We have a function like
class C : function()
{
}
Here the two different functions need to be merged into a single function under a class name.
Now my question is how does the merged entity break into two workflows similar to the functional behavior in the previous separate dlls? What kind of conditional can be put for identifying the different behaviors?
Thanks
|
|
|
|
|
I would suggest using an argument within the definition of the merged function and simply use either a case handler or if statement to control which one is used.
If they perform different processing should they really be merged into a single function?
|
|
|
|
|
How can I make a WAN connection between remote computers behind NAT without using port forwarding.
|
|
|
|
|
|
I am beginer .I have drag an RichTextEdit control to Dialog but it isn't show for me when i debug.
Thank you for helping.
Enjoy for helping
|
|
|
|
|
Have you called AfxInitRichEdit() or AfxInitRichEdit2() somewhere in your code?
|
|
|
|
|
When you run your program you dont see anything if yes you need to call AfxInitRichEdit
|
|
|
|
|
How do you generate content of a child dialog during runtime? I want something like this http://www.codeproject.com/dialog/scrollablechilddialog.asp but all the controls inside the child window need to be dynamically created. For example, the user can specify a number X on the parent window, and then I would generate X number of edit boxes with corresponding buttons in the child window.
|
|
|
|
|
Controls are child windows so create the controls and position them on the dialog window.
Using MFC or not?
Mark
|
|
|
|
|
Yes, MFC.
Can you be more specific? Maybe a sample code how to generate controls and how to position them. Also I will need those controls to be able to display data from the parent window. How can I do that?
Thanks
|
|
|
|
|
Here's the basic idea...dialog should be modeless...
void CMyDialogClass::AddButtonAndEditControls()
{
CButton *pButton = new CButton();
pButton->Create(_T("Text"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON|WS_TABSTOP, CRect(10,10,100,24), this, IDC_BUTTON1);
CEdit* pEdit = new CEdit;
pEdit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_BORDER, CRect(120,10,100,24), this, IDC_EDIT1);
} You'll probably want to keep the created control pointers in a container of some kind
(array, list, whatever) and assign each control unique IDs as they're created. Also adjust the
CRect params to position them properly or use MoveWindow() (example pButton->MoveWindow(...)) to
reposition them after they're created.
Don't forget to delete them when the dialog closes or when you're going to re-populate the window
with a different set of controls.
acerunner316 wrote: Also I will need those controls to be able to display data from the parent window. How can I do that?
Maybe pass a pointer to the parent window to the dialog when it's created so it can call parent
window methods to get the data.
|
|
|
|
|
I understand than all controls must have a unique ID, but if I were to generate the controls dynamically, I want a code that will generate the ID dynamically as well. I don't want to repeat this code for IDC_BUTTON1 through IDC_BUTTON200. Is there a way generate the ID in a for loop or something?
Can you also elaborate on passing pointers from parent window to child window? I am currently trying to call a function of the child class from the parent class to have it update the edit boxes.
for example: CChildDlg::UpdateEditBoxes();
but i'm getting the error "illegal call of non-static member function".
I want to be able to control when the edit boxes are updated from the parent window. So would I have to pass a pointer everytime I update?
Thanks again.
|
|
|
|