Solved

NT Service and MFC

Posted on 1997-02-22
1
247 Views
Last Modified: 2013-11-20
In the article "Creating a Simple Windows NT Service in C++" on the MSDN, I would like to add file handling.  I tried including "afx.h" - not good.  I would like to use CFile class.  How can I do it?
0
Comment
Question by:arie
1 Comment
 
LVL 4

Accepted Solution

by:
mbhakta earned 50 total points
ID: 1300584
I would suggest leave MFC and Services alone because :

- The MFC overheads are tremendous. Services need to be efficient and fast. MFC is easy to use but has some hags in terms of speed as it passes thru its own routines before talking to the OS. This can cause, drastic speed reduction if you implement it in a service. The executable size is also larger.

- Now coming to the real issue. MFC needs its certain entry points as it calls it own WinMain before the regular one. This makes you include things like stdafx.h , CWinApp based classes etc. These entry points not necessarily tally with the entry points of these hooks.

I hope I have convinced you. If not write back and I will give some real life examples.


0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

821 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