|
Derive your view from CEditView . Then, each time you want to append a line of text to the view, do this:
CString strTextReadBySocket = ...;
CString strText;
myEditView.GetEditCtrl().GetWindowText (strText);
strText += _T("\r\n") + strTextReadBySocket;
myEditView.GetEditCtrl().SetWindowText (strText);
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Ravi
Thanks, this works but after a while of printing text to the window I get an Out of memory errors. Is there a limit to how much data can be written to the window ??
Thanks
Gary
|
|
|
|
|
I increased by buffer size to 4096 when receiving data and the memory errors are gone.
How can I get the cursor to stay at the bottom of the window ??
Thanks
Gary
|
|
|
|
|
|
myEditView.LineScroll (myEditView.GetLineCount(), 0);
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I am trying to subclass a CEditView in an sdi app and am having a few problems.
Basically I have the above SetWindowText statment in a class which extends from CEdit.
Now If I create a CEdit control at resource time and put it on a dialog and then call
SubclassDlgItem everything is ok. However I would would really like to mimic the Visual Studio Output Window. What I did was to try and call SubClassWindow in my CEditView derived SDI view in the OnCreate Handler.
However this fails and I read I need to Call SubClassDlgItem for the CEdit Dialog obtained by GetEditCtrl() which is defined in the CView.
However how do I work out the resource id of the CEdit which is created in the CEditView?
I guess if I Create a CEdit control dynamically on a CFormView I would know the resource ID. Basically I am trying to get a general debugging routine which I can attach to any
CEdit or CEditView (Which is dynamically created). I would prefer this than a log window which is a separate window from my application.
Regards,
Axe,
|
|
|
|
|
I have seen and found very few articles on the topic of having animation control for a windows desktop, and would like to know if anyone might have more information pertaining to such a thing.
Some applications have the option of being able to view 3D or 2D based animations on the users desktop screen using such methods as direct draw or Java with html.
Not like the windowblinds application, but more of the line of zmatrix where you can view a fully animated screensaver, but also have and see all desktop icons, toolbars, and still have full control of your system.
he question I have is does anyone know of some good example or articles to teach a person how to develop these type of applications?
|
|
|
|
|
Nobody?
Sheesh looks like this is a topic nobody knowns about?
|
|
|
|
|
if this question has been asked before or answered somewhere else just point me there. anyway I was wondering how I can make a fullscreen, transparent OpenGL window so I could draw 3D objects on my desktop. I mainly want it so I can use Cg shaders and play with my desktop. the only catch is i want the effects to stay under the icons but effects my wallpaper. I want to use my desktop while the effect is going on. does that make sense?
thanks ahead of time.
|
|
|
|
|
Hi all
Suppose i create new structure
and defined for one two diffrent constructors
structure CClass
{
CClass():i(0){}//First construcotr
CClass(int x){//Second constuctor
CClass();//Invoke First construcotr
/*
But this code not initialize i member!!! Why ???
*/
}
/*
If i write my constructor this way
CClass(int i):CClass(){}
My linker complain : 'illegal member itialization
CClass is not a base or member'
???????????????????????????????????????????????????
*/
int i;
}
Thanks much.
|
|
|
|
|
you can't ( ? ) use current class in initialiser list.
maybe doing something like
CClass(int x) { Init(x); }
CClass() { Init(someDefaultValue);} ;
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
C++ does not allow a constructor to call another constructor in the same class. You can only call the constructor of the base class.
For your simple case you can avoid having two constructors by using the default parameters feature (which Java and C# don't have):
CClass(int x = 0) :
i(x)
{
}
Regards,
Alvaro
Give a man a fish, he owes you one fish. Teach a man to fish, you give up your monopoly on fisheries.
|
|
|
|
|
In the first case when you invoke the good constructor but on another anonymous instance!!! Which is totally useless since this new instance has no relation with this
In the second case, you can only use base class constructors in the initilisation list. So it's wrong.
you could use for instance: *this = CClass()
Hope it's been some help
-MyttO
|
|
|
|
|
You could, but you probably shouldn't. Then you'd be constructing an extra object every single time the constructor is called.
|
|
|
|
|
It seriously depends on whether you prefer wasting time coding extra methods, or wasting processor cycles allocating and desallocating memory
All is context dependant...
-MyttO
|
|
|
|
|
Feh. :p It doesn't really take any more time to create an init method.
|
|
|
|
|
Sure, but yet it's still a code fragment in both in Class.h and Class.cpp, and then extra noise in your cade that don't bring much semantics.
One of my most important guidelines in code writing is conciseness: code is easier to maintain, undestand, and even read -- since you don't have to scroll down for hundreds of pages in your favourite editor
But actually, it's clearly more a style than a commandment
-MyttO
|
|
|
|
|
real_space_monkey wrote:
CClass(int x){//Second constuctor
CClass();//Invoke First construcotr
But this code not initialize i member!!! Why ???
Because writing CClass(); in a function body does not invoke the first constructor. CClass() means "create a temporary CClass object using the default constructor." As others have said, that code has no effect on the this object.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
THANKS ALL
|
|
|
|
|
Is there a way to programmically get the users attached to a SQL database with out running a stored procedure?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
As far as I remember, the ADO.Command.CommantText could either a store procedure or any valid SQL statement.
-MyttO
|
|
|
|
|
Hi there!
I would like to write information in the file properties available in the properties tab when right-clicking a file in the explorer.
Especially the title-subject-comment-revision number fields...
I've scanned MSDN and CP but found nothing really useful.
Hopefully you guys got clues!!
-MyttO
|
|
|
|
|
|
Actually this article uses the SetFileTime() function for well known creation/modification/access times properties.
But I can't see any SetFileProperties (?) or whatsoever.
-MyttO
|
|
|
|
|
How about SetFileAttributes ?
Regards,
Alvaro
Give a man a fish, he owes you one fish. Teach a man to fish, you give up your monopoly on fisheries.
|
|
|
|