Solved

NT Service and MFC

Posted on 1997-02-22
1
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
ORA-01403: no data found 43 116
method notes when mouse over in eclipse 5 96
Sed question 2 139
Windows shortcut location resolution on double click open 4 78
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 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