|
Wait a minute!
what is szUserName as the second parameter?
It look like it wants full domain\user path, but if I knew that I wouldn't need to call this on the first place.
So at the moment I get only computer name as when it's not joined to a domain, but it is.
|
|
|
|
|
Um fair points. However you do not need the full qualifying 'domain\username' you can pass just 'username'.
The reason you get the local machine is probably because the szUserName is a local account name also. You could set the szUserName to a domain account name and this should then find the domain that that account resides.
I wish I'd thought a bit longer before posting this as it is not ideal
Ant.
|
|
|
|
|
Ok. For now I'll use GetComputerNameEx and/or NetGetJoinInformation.
But those are just on 2000, XP and 2003.
<dreaming>
Still would be nice to figure out the domain name on like NT and 98.
</dreaming>
|
|
|
|
|
I need to dump data to my SDI window as I read it from a socket. What's the easiest way to do that ?
Thanks !!
|
|
|
|
|
Stick a RichEdit control in the middle of your window and dump all the input into it?
It's dirty, but it works.
|
|
|
|
|
Can you give me an example of how to add it and how to dump to it ?
Thanks !
|
|
|
|
|
Depends on what framework you are using. Since you referred to "SDI", I assume you're doing MFC or WTL. There are a ton of articles on this site which can should you how to add a RichEdit control to either of those windows. Just look around a bit. (Or check out msdn.)
|
|
|
|
|
How about TextOut() ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
David
Any example of using TextOut() ?
Thanks !
|
|
|
|
|
The documentation is pretty self-explanatory. Here's another example.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
You don't. It's passed as a parameter to the OnDraw() method.
void CMyView::OnDraw( CDC *pDC )
{
pDC->TextOut(...);
}
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks for the info but I'm getting confused.
I have a have a ClientSocket::OnReceive() method that reads a CString from a socket(). I want to print this CString directly to my SDI (CView) window. Do I call OnDraw() from this method ??
Thanks again !
|
|
|
|
|
You never call OnDraw() manually. It is called by the framework when drawing needs to take place. At this point, the framework is basically asking, "What do you want to draw?".
It might be wise to read up on the relationship between the document and the view. In a nutshell, the document holds the data that the view renders, or to put it another way, the view renders the data that the document holds.
So, when you receive data via a socket, the document needs to be updated with the received data. The document, in turn, tells the view that something has changed and that a redraw is needed.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
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
|
|
|
|