good points for good answer

Hi guys here's the situation.

I wanna write a windows2000 based app, using VC++6.

The app would only run when scheduled to.  It would have a system sevice that would query a database via dsn connection every 5 min or so.  if it detects that it should run it will spawn off a child process that will do various things on the server, db access, internet access etc.

here's the question.  I wanna know what sort of technologies I would use and how I would integrate them with one another.  this is what I have so far.

I would be using ATL for the system service.  this in turn will use ADO to connect to my db via the dsn.  

when it decides it should run I figured i would then import code stored in DLL's (that way the system service is kept to a minimum).

it all sounds a bit iffy, well that's becuase my kowledge on these topics is a bit iffy :-)  that's where you guys come in.

what I'd like is for someone to clarify what exactly I should be researching to improve my understanding.

LVL 1
MattCAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
DanRollinsConnect With a Mentor Commented:
>> Are services that run with a tray icon any different to those that don't like iisadmin.  

Only in that you need to do the UI programming for it.  You must provide the tray icon handling and whatever popup dialog box, etc. comes up when you double-click the icon.  Also, the service must be configured to "allow to interact with the desktop."

>> Also what is the difference in using #import to use functions stored in DLL's as opposed to using CreateInstance (COM).  Would it be better to write my DB and internet access classes in DLL that are importable or
DLL and use COM to implement them?

I think this is

A COM style interface is the way to go for many types of projects. It provides a generized way for any program (VB, Javascript, C++) to access its functions.  

But there is a considerable learning curve to writing your first COM object.  From what you describe, there is no need for it in the scenario that you paint.  Just wirte a Service that wakes up every 5 minutes, does its job, then goes back to sleep.  "Its job" would be to spawn some other program, make some additional datbase accesses,... whatever.  It could read its settings from a manually maintained INI file (or registry settings) Or you can have a separate (very simple) dialog-based app maintain those settings.  Once the core functionality is there, you can dress it uo with a UI, tray icon, etc.
-=--=-=-=-=-=

All this stuff about DLLs and COM is, i think related to this from your original Q:

>>when it decides it should run I figured i would then import code stored in DLL's (that way the system service is kept to a minimum).

Keeping the system service footprint small is fine, but hardly relevant unless you are talking about grabbing and holding 5MB of memory -- unlikely in the task you describe.  Just write the NT Service code without getting fancy.  Memory considerations can be fixed up later.

-- Dan
0
 
Toad224Commented:
Windows has something called "Scheduled Tasks" which would allow you to run something every 5 min. or so...  Look in the control panel...
0
 
DanRollinsCommented:
I have done a similar project, but in MFC.  That made it easy to create a Tray Icon for access to settings, etc.  I started with a CNtService class that I had hanging around.  Patched in the UI of a dialog-based app and used CRecordset for db access.

There is really nothing to it.  But since you are here in the C++ section, you are probably an MFC hater, so... never mind.

-- Dan
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
MattCAuthor Commented:
no I am using the MFC's for CinternetSession and all the other classes.  Are services that run with a tray icon any different to those that don't like iisadmin.  

Also what is the difference in using #import to use functions stored in DLL's as opposed to using CreateInstance (COM).

Dan,

If you have a simple system service then post it in my other question please :-)

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=cplusprog&qid=20138513
0
 
MattCAuthor Commented:
Are services that run with
a tray icon any different to those that don't like iisadmin.  

Also what is the difference in using #import to use functions stored in DLL's as opposed to using CreateInstance
(COM).  Would it be better to write my DB and internet access classes in DLL that are importable or DLL and use COM to implement them?
0
 
MattCAuthor Commented:
thnx dan the points are yours if you can just clarify my last question.
0
 
MattCAuthor Commented:
thanks Dan,

well I figure I'll do as u suggested, run a job checker as a service using ATL, when a job needs to run it will just thread off another process and go back to sleep.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.