-
I already know what I have to do to the registry to make my .exe a service, but what I am not sure about is this: Should I just open up a 'new standard exe' and make the form invisible. I need to use some components, like winsock, so I need to have the form there to add the components to. Any suggestions on this will be greatly appreciated.
Thanks,
jk
-
Dont use forms
Use Module with
Sub main()
.....
End sub
then set the project Properties start up as Sub main
Most of the sites I referred warned me of adding a VB exe as a service. Hence I have to do with Running it at start up.
We have an exe running always in our machine. But we have added the exe in startup so that when a user logs into the machine it gets started.
since we want the exe to be running always we keep the machine logged on always.
Ramdas
-
yes, i have read the same thing about not making vb apps a service. something about not supporting multithreading 100 percent or something like that. however, i need to have this simple exe running, even when the user is logged off.
so my next question is this, if i make it module then how do i add components like winsock to the project?
thnx, jk
-
To add a DLL such as winsock.dll to a module you need to set a reference to it using the references item of the project menu.
You then access it by
DIM oXXX as NEW xxxxxx
or
DIM oXXX as XXXXX
set oXXX = NEW XXXXX
-
I've tried creating a winsock control at runtime (when its included in references) and I just cant get it to newup the object. I've tried:
Private Withevents Winsock1 As Winsock
Set Winsock1 = new Winsock
and also
Private Withevents Winsock1 As Winsock
Set Winsock1 = CreateObject("MSWinsockLib.winsock")
I had to end up having a form with a winsock already on it which wasnt as nice as I had hoped. Any ideas?
-
To create a control from scratch.
Code:
Controls.Add "MSWinsockLib.Winsock.1", "Winsock"
-
That would work for if it was to be created within a form. But to encapsulate it within a class module which doesnt have a controls collection, how do you do that?
(Sorry to divert off the main topic)
-
so megatron, if i this code,
Controls.Add "MSWinsockLib.Winsock.1", "Winsock",
to create a winsock control how would i fire a connection request event, or any event in general(close, data arrival, ect.) if you can help me i would greatly appreciate it.
thanks
jk
-
JJK,
Did anybody get back to you with information how to do this? I would also like to be able to do what you're doing and capture the events in a class since I can't use a form.
-
No not really. I got my app to run as a service but as far as making the controls and using the events that they support I never really figured that out. I found that I really didnt need to do any of that for the application I was creating so I figured I would wait until I needed to do it to do more research on the matter. Sorry I can't help you. If you do figure out how to do this, email me with the solution at [email protected]. Thanks.
JJK