Solved

Coverting process for vb6.0 app to NT service

Posted on 2002-03-26
6
551 Views
Last Modified: 2008-01-16
Dear experts
I am going to convert a VB 6.0 application to NT service.
I have downloaded an OCX for this purpose from following web site
http://msdn.microsoft.com/library/techart/msdn_ntsrvocx.htm
but the problem is thst I can not understand the whole process that I must follow to converet it into NT service i.e after writing code (that is mentioned in the above web site)what step i should follow. What steps I should follow in this whole converting process.
you should also know that my form should be invisible as ymy service is running.
Waiting anxiously for your response.
Thanks to all genious experts.
0
Comment
Question by:habibb
  • 4
6 Comments
 
LVL 1

Accepted Solution

by:
EstebanFG earned 20 total points
ID: 6899149
You can use SRVANY to convert a VB executable into an NT Service.
Microsoft's WinNT RESKIT includes a very useful utility that allows you to convert most DeskTop applications into a SERVICE application. This basically means that you can run an application behind the scenes i.e. it doesn't depend on a specific user to log on.
 
These are the steps that you should follow:

1.     Create a directory under your root and call it SRVANY and copy these three files:
SRVANY.EXE, SRVANY.WRI, and INSTSRV.EXE into the SRVANY directory.  The files come from the WinNT RESKIT.

2.     Go to the DOS Command prompt and navigate to the SRVANY Directory. At the command prompt type:
INSTSRV <service name> c:\srvany\srvany.exe

(Notice the second element on the command line " <service name> ". This is the "name" of the service that you will create. Later, you will go to the SERVICE applet in the CONTROL CENTER and will access the service by this name. Since you are creating a name, you can call it anything you want, so don't be too vague.)

3.     Exit the DOS COMMAND Console, and fire up the REGEDT32.EXE. Be careful while you are in there, don't mess with other stuff.

4.     Open up the HKEY_LOCAL_MACHINE window and double-click on the SYSTEM branch. The branch opens up and you should see the CurrentControlSet branch. Double-click on that one and the Services branch should appear. Double-click on the Services branch and a long list of branches is displayed.

5.     Scroll down until you find the name of the service that you created.

6.     Double-click on the name of your service and leave this highlighted.

7.     Move the cursor up to the EDIT menu bar and click on "Add Key..."

8.     The Add Key dialog box is displayed. In the "Key Name" text box type: Parameters

9.     Highlight the Parameters Key and bring your cursor to the EDIT menu bar again and click on the Add Value choice.

10.     In the "Value Name" text box type in: Application
From the "Data Type" list box choose: REG_SZ
Now press OK

11.     The String Editor Dialog box will open up. Enter the full path to your program's executable.
For example:  c:\MyApp\Sample.exe
Press OK .

12.     Highlight the Parameters Key and once again bring your cursor to the EDIT menu bar again and click on the Add Value choice to add another key.

In the "Value Name" text box type in: AppParameters
From the "Data Type" list box choose: REG_SZ and press OK

13.     When the String Editor dialog box opens up add and opening parameters that your program needs in order to run.  If none are needed, you can skip this step.
 
Close it all up and exit the REGEDT32 program. Now you can breathe easy again. The worst is over. Move to the Control Panel.

14.     Open up the SERVICE Applet and scroll to the name of your service line and double click on it.

A dialog box opens up. Choose the Startup Type: Automatic (for unattended operation, this will allow your service to be active when there is no one logged on).  If you want this service to run under a specific account,oOn the “Log On” tab, click on “This Account”, then Browse. Highlight the account name and click OK.

15.     Click on OK on the service property box and exit the services.

16.     Reboot the machine.
0
 
LVL 4

Author Comment

by:habibb
ID: 6899259
Dear EstebanFG
Thanks for your easy steps I shall increase points upto 5 if I succeeded.
thanks again
0
 
LVL 4

Author Comment

by:habibb
ID: 6902082
EstebanFG I have follow your Instructions and succeeded but I am facing some problems. when i press start button (on the serevice applet in control pannel) it display following error message:
Could not start 'Myservicename' service on \\Mycomputername
error 2186 the service is not responding to the control function.
moreover it does not run  even no user is login.
I hope you will understnad my problems.
I am waiting for your Quick response. thanks
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 4

Author Comment

by:habibb
ID: 6909638
wakeup EstebanFG and help me.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7014025
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.
http://www.experts-exchange.com/questions/Q.20102945.html
http://www.experts-exchange.com/questions/Q.20106475.html
http://www.experts-exchange.com/questions/Q.20206747.html
http://www.experts-exchange.com/questions/Q.20069932.html
http://www.experts-exchange.com/questions/Q.20281920.html
http://www.experts-exchange.com/questions/Q.20285967.html
http://www.experts-exchange.com/questions/Q.20297681.html



*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=commspt&qid=20274643
POINTS FOR EXPERTS awaiting comments are listed in the link below
http://www.experts-exchange.com/commspt/Q.20277028.html
 
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
 
Thanks everyone.
Moondancer
Moderator @ Experts Exchange
0
 
LVL 4

Author Comment

by:habibb
ID: 7020797
Problem in provided solutions. Not exact solution
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now