|
ur question is bit confusing!!!!!!!!!
Thanx
TAKE CARE
|
|
|
|
|
You can use this to get the selected Item.
void C3StateTree::OnRButtonDown(UINT nFlags, CPoint point)
{
UINT uFlags = 0;
HTREEITEM hItem = HitTest(point, &uFlags);
Arjan.
|
|
|
|
|
Maybe knowledgebase article Q222905 can help you?
It describes how to get the item that was right-clicked.
Angel Kid wrote:
YES, I am here.
No, you are not! *I* am here, but you are there! ;P
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
jhwurmbach wrote:
Angel Kid wrote:
YES, I am here.
No, you are not! *I* am here, but you are there!
*shakes head in disbelief*
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I found in the MSDN ,but can't found the Q222905????????
YES, I am here.
|
|
|
|
|
On this[^] page, on the top right, enter Q222905 into the edit field and click the radiobutton for 'Knowledgebase' below. Now click the button labled 'Go'.
You will get exactly one result link.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
|
As to multi-threaded programming knowledge I still know very little
Do you know How I want to master this skill
But I have not find any material.
Would you like to introduce some good articles available for me?
Thank you in advance!
|
|
|
|
|
|
Here are some:
http://www.flounder.com/callbacks.htm
http://www.flounder.com/uithreads.htm
http://www.flounder.com/workerthreads.htm
|
|
|
|
|
|
some device continues to send datas (UDP) to one port of
my computer ,now i needs to get the datas and send it out.
how can i do it .what functions shall i use ??
THANKS A LOT !
a good man
|
|
|
|
|
|
I need to remember the values of variables that were assigned in one dialog box after that dialog box creates another dialog box. Because I don't want to use global variables I have resorted to using hidden controls on the first dialog box to store the values. Then the second dialog box can access them with CWnd* wParent=GetParent(); and wParent->GetDlgItemText(IDCONTROL, String);
But this seems really contrived and kludgy.
I tried using Class Wizard to create member variables, but I could only see controls listed.
Is this workaround I have been using really the way to store variables that are accessible by child windows?
|
|
|
|
|
I either pass the values into the second dialog box or pass a pointer to the first dialog box to the second dialog box.
John
|
|
|
|
|
My example showed the use of a pointer to the first window - the CWnd* wParent = Getparent(); so I didn't need to pass the variable - but how do you pass a value to the second dialog? When I call dlg.DoModal() it doesn't allow for parameter passing.
|
|
|
|
|
Set your values in the second dialog before you call do modal.
CDlg1::OnOK()
{
CMyDlg dlg2;
dlg2.m_var1 = m_var1;
dlg2.DoModal();
}
John
|
|
|
|
|
That looks like what I was hoping for!
Another question - does that mean I need to create controls and assign variables to the controls on dialog 2 instead of dialog 1 (in which case it is still kludgy)? If not, where do I define m_var1?
I am hoping there is a way to assign simple variables without the superfluos creation of controls that will never even be visible. If that is just the way it is done in MFC then I can live with that, but it just seems like there should be a non control-based way......
|
|
|
|
|
Terry O`Nolley wrote:
I am hoping there is a way to assign simple variables without the superfluos creation of controls that will never even be visible.
You will never have to do that.
John
|
|
|
|
|
Terry O`Nolley wrote:
Another question - does that mean I need to create controls and assign variables to the controls on dialog 2 instead of dialog 1
No you do not.
Terry O`Nolley wrote:
If not, where do I define m_var1?
It depends what you are doing. A CDialog class is a C++ class so you can assign variables just as you would with a C++ class. I am sorry I am not more specific but I am a little confused about what you are trying to accomplish.
[EDIT]
Ok I see what you are doing in the other thread. I'll look at that and see if I have an easy solution.
[/EDIT]
John
|
|
|
|
|
|
This was a good pointer that I have bookmarked. Thanks!
Let me explain what I am doing.
I've incorporated Chris Maunder's excellent CGridCtrl into a project. I query a remote SQL database and populate the grid with the record data. When a user double clicks on a record, another dialog fires up with all of that record's data in it. What that second dialog box needs is the record id from the previous dialog box.
Dialog A: Contains a grid control populated with database rows and a hidden edit control.
When a user double-clicks a row in the grid, the record ID from that row is copied to a hidden edit control. :
SetDlgItemText(IDC_CRECORDID, csKey);
Dialog B: Needs to access the record ID in the edit control from Dialog A:
Cwnd* wParent = GetParent(); // get pointer to Dialog A
CString csKey; // will hold the edit control text
wParent->GetDlgItemText(IDC_CRECORDID, csKey); // get the text
The code above to me seems a lot cleaner than doing all of that variable assigning and editing of the class wizard supplied mappings.
I have no problem with the concept of assigning control member variables, but I still see creating a control just so I can assign a member variable to it just so I can hide it just so I can use it as a storage location for an integer as a kludge.
Isn't there a way to just pass variables from one dialog to another?
|
|
|
|
|
Terry O`Nolley wrote:
Isn't there a way to just pass variables from one dialog to another?
There are lot's of ways. You can do as John said and initialize the variables between the dialog class declaration and the DoModal() call. You can pass the values in via the constructor (write your own constructor, forget about ClassWizard, it is very limited), you could write your own DoModal() function that takes the required parameters, or, if your second dialog is modeless, you can use custom messages.
It seems all you are doing is creating an extra control, with all it's overhead, when all you really need is a CString member variable in your first dialog.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
PJ Arends wrote:
It seems all you are doing is creating an extra control, with all it's overhead, when all you really need is a CString member variable in your first dialog.
And thus the very reason for my post!
|
|
|
|
|
Declare a string in the second dialog to hold the record id (m_strRecordID). Before you call DoModal() for the second dialog set m_strRecordID to the records id.
John
|
|
|
|