|
Hello!
I want to implement some kind of history log with CEdit controll. But here is the problem; CEdit only have SetWindowText method. Is there a way to add just one line of text? Now I do multiple lines with text in string buffer separated by "\r\n". To add some line, I add text to this buffer and separate it with "\r\n" and after it I call SetWindowText on CEdit control. Here I have a problem how many srolls to do when I get ower the edit control visible lines limit.
Is there any better way? Just to add line of text and if out of visible lines srcoll just one line?
Best regards,
Rostfrei
|
|
|
|
|
I can think of two ways to add a line:
- Call GetWindowText , tack on the new line then call SetWindowText . This is somewhat inefficient.
- Use EM_SETSEL and EM_REPLACESEL messages which are wrapped by CEdit::SetSel and CEdit::ReplaceSel respectively.
Steve
|
|
|
|
|
I use this code:
m_EditRcvdMsg.SetSel(-1, 0); //select no text
m_EditRcvdMsg.ReplaceSel(pMsg);
m_EditRcvdMsg.SetSel(-1, 0); //select no text
m_EditRcvdMsg.ReplaceSel(_T("\r\n"));
//scroll into position
m_EditRcvdMsg.LineScroll(1);
|
|
|
|
|
Thank you! It works like a charm!
Thank you everybody for all your responses!
Regards,
Rostfrei
|
|
|
|
|
|
Rostfrei wrote: I want to implement some kind of history log with CEdit controll.
See here.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Does anybody know how to check if a user is part of a WINNT group.
|
|
|
|
|
Sure, but you did not specify whether the group was local or global. Check out NetLocalGroupGetMembers() or NetGroupGetUsers() .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Let me try it. I want to check both local and global groups.
I have spent the whole day struggling
Kelvin Chikomo
|
|
|
|
|
sometimes it so happens that a process is accessing a file and it makes it uneditable or undeleteable. Is there a way by which we can detect which process is accessing the file? that way we could possibly kill it to enable file edition.
kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
Look Here[^]. Look for "Handle" under "Processes & Threads". These guys are geniuses.
Steve
|
|
|
|
|
great tool, but they are not giving the source code for this software, neither explaining how they are doing it...i need to know how it is done.
Thanks for your help, anyway
kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason huh ?"
|
|
|
|
|
Hi
I am doing some Image processiong stuff.
I draw a Region of interest(ROI) over the image using mouse. freehand drawing.
now I want to know how to find out if a point is inside that region? any algorithm please suggest?
In case of Rectangular ROI there is no problem. I am not able to get algorithm for freehand image area.
I need your help.
Anil
|
|
|
|
|
Save the points as you draw the ROI, use CreatePolygonRgn() to create a HRGN from those points, use PtInRegion() to determine if a point is inside your ROI.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
-- modified at 2:48 Monday 30th January, 2006
|
|
|
|
|
Hi
Thank you very much
I am waiting for a reply.
I am going to implement your method. I will let you know it it works.
And hope to help me if I will stuck some where.
Thankx again.
Regards
Anil.
|
|
|
|
|
Hi
Thank you very much.
I am able to get the result.
Regards
Anil
|
|
|
|
|
HAI,
I am not able to put the IStream generated by me into the IDataObject.Here is the code snippet can anyone point out where i am going wrong?
IStream *lpStream = NULL;
//Put some data into IStream
LPDATAOBJECT pDO = new LPDATAOBJECT();
//FORMATETC definition
FORMATETC *fmtetc = new FORMATETC ;//= {0};
fmtetc->cfFormat = CF_TEXT;
fmtetc->dwAspect = DVASPECT_CONTENT;
fmtetc->lindex = -1;
fmtetc->tymed = TYMED_ISTREAM;
fmtetc->ptd = NULL;
//STGMEDIUM definition
STGMEDIUM *medium = new STGMEDIUM ;
medium->tymed =TYMED_ISTREAM;
medium-> pstm = lpStream;
lpStream->AddRef();
medium->pUnkForRelease = NULL;
//I get error in this line.
pDO->SetData(fmtetc,medium,TRUE);
Can anyone tell me what i should do before calling the setData()?
Thanks in advance.
Saravana Kumar
-- modified at 2:24 Monday 30th January, 2006
|
|
|
|
|
What is the size of a empty class
If the size of the class is zero what can be the problem
with the class?
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
vikas amin wrote: What is the size of a empty class
1 or (>0)
vikas amin wrote: If the size of the class is zero what can be the problem
with the class?
It cannot be zero.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#99ccff;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Defeat is temporary but surrender is permanent
--Jesus is Lord
|
|
|
|
|
first thing...
The size of the empty class is 1 if it doesn't contains any member variables
else its size is the total bytes required for the variables in that class.
second thing...
if the class contains atleast one virtual function then its size is 2 bytes without member variables
as the object of the class contains the address of the VTABLE.
for the existance of the object the class having minimum 1 byte size.
Thanks and Regards
Laxman
FAILURE is the first step towards SUCCESS
|
|
|
|
|
Yeh i checked it IDE but the question
is why ?
For a class containing only one "char" variable the
size of the class is 1 . how???
even if the class is empty its 1 and even if it has a
character variable its one?
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
that is the trick
if class contains any variable the size of the class is the summation of bytes of member variables
and if no variables then it's size is 1 byte.
and as we know that minimum variable size is 1 byte and those for char variables.
Thanks and Regards
Laxman
FAILURE is the first step towards SUCCESS
|
|
|
|
|
|
The size of an empty class is non-zero. Otherwise, two empty classes of the same type would have the same address.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I am a newbie in C++ and looking for your help!!
In the below 2-dimensional arrays, what are the index numbers of A, B and C?
_| 0 | 1 |
0| A | B |
1| C | h |
Is (0, 0) the index number of A?
Is (1, 0) the index number of B?
Is (0, 1) the index number of C?
If so, how can I put, let's say, the index number of A(0, 0) into a temporary variable for swapping with the "hole"(1, 1)?
Please advise?
Thanks in advance!!
|
|
|
|