Link to home
Start Free TrialLog in
Avatar of mnichols
mnichols

asked on

Winsock control and formless (windowless) applications

I'm trying to use the Winsock control in an application that has no forms (windows). My goal here is to be able to write server applications that load no windows into memory. Code samples and explanations would be helpful. Thanks.
--
Matt Nicholson
mnichols@cs.fit.edu
Avatar of mrmick
mrmick

Matt, I assume you're writing a service that doesn't have a stdout or stdin.  To accomplish this you still must use a form, just don't show it.

What's the status on the Controlling Dos Window question?

Avatar of mnichols

ASKER

Actually this project has nothing to do with controlling DOS windows. And being this is a Visual Basic project, there isn't such a thing as stdin or stdout. I've experimented with the WithEvents keyword when creating a Winsock control, and it appears to turn it into an object, but I can't quite get it to work. Also, I can't use the New keyword to create a new instance of the control, which I think is the key to getting it to work. Dropping a control on a window that has no visual inputs and is never shown is quite silly-- wastes memory. Besides, I'm trying to write an Active DLL, which isn't supposed to have forms anyways. I'm sure there's a way to do it, so I'm leaving the question open.

The DOS window controlling problem is still in the back of my head somewhere. I really want to accomplish it in Visual Basic so it's still up in the air if anyone wants to answer it.
--
Matt Nicholson
mnichols@cs.fit.edu
ASKER CERTIFIED SOLUTION
Avatar of mrmick
mrmick

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you believe that hidden windows aren't anything to be concerned about as far as memory is concerned, then okay. I just thought it would be an accomplishment to be able to use controls without using forms. Thanks for the help.
--
Matt Nicholson
mnichols@cs.fit.edu
Matt,

The form will add bytes to the project, but very minimal compared to the bytes allocated anyway.  Of course, I'm talking about an empty form - which is essentially what we're talking about because anything associated with the objects on the form (the winsock control) would be necessary even if you could create the objects without the form.

Why the "C"?
Well, the answer was acceptable, but not the one I was looking for. A code sample that would tell me exactly how to accomplish my task would deserve an A. Sorry, but I'm very demanding when it comes to answers
hmmm...

I thought I covered the explanation part pretty well.  You expected a code example of placing a control on a form?  My answer may not have been what you wanted - but it was the correct answer to your question.

Very demanding?  Do you realize that those who answer questions here do not get paid?

I'll try to keep in mind, before I offer an answer to one of your questions again, that you have a tendency to slap those who help you when you don't like the answer - even when the answer is correct.