|
|
|
maybe it is some helpful to you Here[^]
whitesky
|
|
|
|
|
I use movewindow() to change size of tree,after that how to judge whether should show scroll bar?
The tree cant show scrool bar automatically.My app is based on dialog.
I want to show scroll bar according to the widest item
whether full visible. However, how to get the widest item expanded?
-- modified at 3:41 Tuesday 23rd May, 2006
|
|
|
|
|
Hello,
I have derived my class from CRichEditCtrl and now I want to check the handle of this class with NULL. For that I need to retrive the Handle of the CRichEditCtrl window. But CRichEditCtrl don't have any functionthat returns a Handle. How shall I proceed then?
Regards
Rakesh
Rakesh
|
|
|
|
|
Rakesh_Thakur wrote: But CRichEditCtrl don't have any functionthat returns a Handle. How shall I proceed then?
GetSafeHwnd() or m_hWnd (member variable).
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
i have 2 edit controls . whatever i enter in the first control should be added to second control. the second edit control already contains some text. the newly entered text must be added to the second edit control wihtout erasing the contents of second edit control. pls tell me the code to do this
Thanks
|
|
|
|
|
m_Edit1->GetWindowText(str1);
m_Edit2->GetWindowText(str2);
str2.Insert(0,str1);
m_Edit2->SetWindowText (str2);
whitesky
|
|
|
|
|
seems this wont wont work.....
because, when it comes for the second time, repeated characters will be the result.
e.g:
text1: Tes
text2: Fixed
first time output
str2: TesFixed
second time I append a character "t" in text box
the output will be
str2: TestTesFixed
seems he is not seeking for an output like this
SaRath
|
|
|
|
|
this is only one way not code for run i know if use this code it concat str1 to str2 and repeat to....(you can see that i write only str)
I dont know that he wants where use this way
whitesky
|
|
|
|
|
there r 2 edit controls ("name" and "store"). the first control is where text can be entered. the second control stores all the txt eneterd in first control on clck of button
for ex:name : vc++
store:c c++ java html
the store edit control already contains sum text. when i enter vc++ and click a button vc++ shud be added in "store" and the final output wud look like
store:c c++ java html vc++. here nothing can be entered in store control.this is what i want to do
-- modified at 2:54 Tuesday 23rd May, 2006
|
|
|
|
|
if you want to insert when you click button I suggest use GetWindowText and SetWindowText and one CString for get string from edit1 and check if you want that text insert to end of string use Insert(str.getlength(),str) in first parameter from Insert but if you want to insert to first string use Insert(0,str);i think its easy
whitesky
|
|
|
|
|
can u tell me how this can be implemented in code?i am new to vc++
|
|
|
|
|
<br />
void CAnswer::OnBnClickedMybutton()<br />
{<br />
CString str1,str2;<br />
m_Edit1.GetWindowText(str1);<br />
m_Edit2.GetWindowText(str2);<br />
<br />
str2.Insert(0,str1);<br />
<br />
m_Edit2.SetWindowText(str2);<br />
m_Edit1.SetWindowText("");<br />
}<br />
<br />
<br />
whitesky
|
|
|
|
|
if u want to update the data on keypress
Map the key press of the input text box ( say IDC_TEXTIN)
else
do the following on button click or the operation u want to update the text boxes
1. Keep the length of IDC_TEXTOUT when u update the text for the first time.
CString strTextIn;
CString strTextOut;
GetDlgItemText(IDC_EDITIN,strTextIn);
GetDlgItemText(IDC_EDITOUT,strTextOut);
// take the fixed amount of string
CString strFixed = strTextOut.Left(m_nLength);
strTextIn.Left(m_nLength);
// Create a new string
strTextOut = strFixed+strTextIn;
SetDlgItemText(IDC_TEXTOUT,strTextOut);
do the needful assertion checks
SaRath
|
|
|
|
|
You might need to clarify your question a bit more.
For example:
Text 1: ""
Text 2: "Bar"
User types "ABC" into Text 1.
Text 2 becomes: "BarABC" correct?
Now, what if user edits Text2? User types "123" at the end of Text2.
Text2 is now: "BarABC123"
Now, the user switches back to Text1 and types "EFG".
Should Text2 now contain "BarABC123EFG" or "BarEFG"?
If it's the first case you can do something like the following in the EN_CHANGE message handler (or OnChange):
<br />
CString strText1;<br />
CString strText2;<br />
GetDlgItemText(IDC_TEXT1, strText1);<br />
GetDlgItemText(IDC_TEXT2, strText2);<br />
<br />
strText2 += strText1;<br />
<br />
SetDlgItemText(IDC_TEXT2, strText2);<br />
If it's the second case, you'll have to cache Text2's value, when you enter the dialog and do:
<br />
CString strText1;<br />
CString strText2;<br />
GetDlgItemText(IDC_TEXT1, strText1);<br />
GetDlgItemText(IDC_TEXT2, strText2);<br />
<br />
strText2 = m_strCachedText2 + strText1;<br />
<br />
SetDlgItemText(IDC_TEXT2, strText2);<br />
Man, I hoped that makes sense, it sounded good in my head until I typed it
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Handle EN_CHANGE event of Edit control you will get function as
OnChangeEdit1();
In this function you can paste the code as :
<br />
CString str1;<br />
CString str;<br />
m_edit1.GetWindowText(str);<br />
m_edit2.GetWindowText(str1);<br />
str1= str1+str;<br />
m_edit2.SetWindowText(str1);
Here m_edit1 and m_edit2 are the control variables for the edit boxes.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
I want to study this software
|
|
|
|
|
|
|
why it is "Mozilla"
The Mozilla is used to Creating Applications
I need the source of firfox
--------------------------------
fisheryj # gmail.com
jerry
|
|
|
|
|
wrote: why it is "Mozilla"
As it's a product of Mozilla
Here is the source code[^]
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi,
In VC++ i have the following line in VC++ to send bytes to ActiveX control, when i debug it i can able to see &(abData[0]) will return address of first element and i am sending the same to control.
Byte *pbManagedData = &(abData[0]); // Get starting point of Array
axSimpleAdditionAtx1 ->SendBy(pbManagedData,3); // Send it to Active-X
In ActiveX control i am having following signature to receive the memory pointer. But i can able to see junk values alone; please let me know whats wrong with this.
void VRMControl::SendBy(BYTE* ByteValue, LONG Length)
{
BYTE val[3];
memcpy (ByteValue,val,3);
}
|
|
|
|
|
sivaprakashshanmugam wrote: BYTE val[3];
memcpy (ByteValue,val,3);
val isn't initiated, and contains garbage (whatever is on the stack).
And then you copy that junk to ByteValue...
|
|
|
|
|
Shall i do like this
ZeroMemory (val,3);
memcpy (val,ByteValue,3);
In memcpy - Val is Destination and ByteValue is Source.
Else please give me small code snippet. To read BYTE* in to string as per my previous code.
Thanks alot!!.
|
|
|
|