473,399 Members | 4,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

programming a service

I am using MS Visual studio 2003 C++
I am tring to program my first service and am having many questions and
issues.
1) Is there any documentation/ book that has good examples with details on
how decsions where made in selecting various service options.

2)I would like to create a log file, but when I use LocalService as an
account I don't have permission to open files. I was able to open files when
set account to LocalSystem, but this seems overkill and maybe to permissive.

3) I need to be able to open an .ini file which I believe I will have in the
directory where service executable gets installed. The service seems to know
what directory this is, but I can't figure out how to get directory
information so that I can open the file. if I use the _getcwd command it
returns the C:\windows\system32 directory. I don't want to have to hardcode
this information in program, since it may be installed in different
directories

4) I will be using ADO.net to access a remote oracle database so I don't
know if this has any bearings on how I set up the service, especially the
account.

In General my service is going to be reading input from a card reader that
is on the local PC and place the data in a remote oracle database. So any
suggestions on how to procceed learning what I need to know to do this would
be appreciated. I am planning to have 1 thread read data from unit on PC and
another thread to place data into database using ADO.net. I am not very
familiar with .net programming but have gone through microsofts visual C++
..NET step by step book for version 2003.

Nov 29 '05 #1
1 862

brian_harris wrote:
I am using MS Visual studio 2003 C++
I am tring to program my first service and am having many questions and
issues.
First suggestion would be to develop and debug your service as a regular
application. Then turn it into a service and sort out all the
permissions problems. :)
1) Is there any documentation/ book that has good examples with details on
how decsions where made in selecting various service options.
Lots of stuff in msdn.

2)I would like to create a log file, but when I use LocalService as an
account I don't have permission to open files. I was able to open files when
set account to LocalSystem, but this seems overkill and maybe to permissive.
Try locating the log file in c:\windows\temp\ and see if you still have
problems creating it.

3) I need to be able to open an .ini file which I believe I will have in the
directory where service executable gets installed. The service seems to know
what directory this is, but I can't figure out how to get directory
information so that I can open the file. if I use the _getcwd command it
returns the C:\windows\system32 directory. I don't want to have to hardcode
this information in program, since it may be installed in different
directories
You can store the ini filename in the registry, setting it up at install
time. Or use call the win32 api GetModuleFileName to find the path of
the exe.
4) I will be using ADO.net to access a remote oracle database so I don't
know if this has any bearings on how I set up the service, especially the
account.
Should be right... :)

In General my service is going to be reading input from a card reader that
is on the local PC and place the data in a remote oracle database.
In my experience, card readers are a bit of a nightmare... so good luck.
So any
suggestions on how to procceed learning what I need to know to do this would
be appreciated. I am planning to have 1 thread read data from unit on PC and
another thread to place data into database using ADO.net. I am not very
familiar with .net programming but have gone through microsofts visual C++
.NET step by step book for version 2003.


Oh... so you're actually developing a .net app not a native app? Do it
in c# then. :)
Dec 5 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ted | last post by:
Hi all, I am trying to learn C socket programming and I have a small program which is a UP client. The problem is, when I run the program, I get a runtime error - "Invalid Argument" - from a...
6
by: MR | last post by:
i would appreciate some assistance in finding a reference that describes how to set up a tcp/ip server/listener in c#. also samples would come in handy. thanks m
2
by: Ed_P | last post by:
Hello I just wanted to get the opinions of those of you who have experience developing C# applications and programming in general. I currently am learning the basics of programming (choosing C#...
5
by: Chakkaradeep | last post by:
Hi all, in my service i added my Registry Programming code,am facing with a problem which am not able to rectify it..the problem is , in the service, the program gets hanged and doesnt move...
2
by: Chris | last post by:
Hello, With asynchronous programming : Why does the callback-function (running in a worker thread) may not update the state of a control on the main-form ? The docs say that you must use a...
4
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am...
3
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
2
by: =?Utf-8?B?U3JpcmFtIE1hbGxhanlvc3VsYQ==?= | last post by:
Hi, I was going through the article (http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/) regarding async programming in ASP.Net 2.0 but did not find much of an use with it. Actually...
5
by: gnanapoongothai | last post by:
hi, i am a beginner in socket programming in vc++. There is error poping up when the addr of the socket is compling, .\simple_socketsever.c(41): error: identifier "sockaddr_in" is undefined ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.