15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


MFC & NT Service

Gerry Sweeney -- gerry@hornbill.com
Tuesday, June 25, 1996


Hi Listers,

I am using NT 3.51 and MSVC v2.1. Does anyone have an example of using the 
MFC within an NT Service? I have some code which I would like to have as an 
NT Service but it depends on CObject derived objects.

Any help, pointers would be appreciated

Gerry Sweeney
gerry@hornbill.com



emiro@datmarkets.com.ar
Saturday, June 29, 1996

[Mini-digest: 5 responses]

You can just create an dialog based app and start the service in =
InitInstance like if you were in main but returning FALSE when you =
finish...

----------
From: 	Gerry Sweeney
Sent: 	Tuesday, June 25, 1996 3:15 PM
To: 	MFC List
Subject: 	MFC & NT Service


Hi Listers,

I am using NT 3.51 and MSVC v2.1. Does anyone have an example of using =
the=20
MFC within an NT Service? I have some code which I would like to have as =
an=20
NT Service but it depends on CObject derived objects.

Any help, pointers would be appreciated

Gerry Sweeney
gerry@hornbill.com
-----From: Frank McGeough 

You probably don't need an example. Using MFC collection classes or
CAsyncSocket, etc. is pretty straight forward. You may need to declare
the following global for appeasing the MFC :

CWinApp theApp;

Of course you won't use any AppWizard doc-view type code for your service.

I would advise that people should use STL for collection type behavior
in services but I've integrated MFC derived classes into a couple
of services and it works fine.
__________________________________________________
Frank McGeough      fm@synchrologic.com
Synchrologic, Inc. (http://www.synchrologic.com/)
Voice: 404.876.3209            Fax: 404.876.3809
-----From: Babette Frank 

Hi Gerry,

there is a sample on MSDN. The title of this articel + sample is =
'Creating a Sinple Windows NT Service in C++' and the book is 'Technical =
Articles: Windows: Networking'.

Hope this helps,

Babette
-------------------------------------------------------------------------=
------------
Babette Frank                                          Telefon.:   =
+49.30.39094-152
Condat GmbH                                          Fax:            =
+49.30.39094-300
Alt-Moabit 91 d                                         e-mail:        =
bf@condat.de
10559 Berlin, Germany
-----From: david@metra.com (David Budworth)

It seems that any service with a global C++ object will fail when the call
the StartServiceCtrlDispatcher attempts to return.  I think that just using
MFC makes several global C++ objects.

As soon as NuMega can fix SoftICE NT, I'll try to post why this happens.

For now, make the last line of ServiceMain() do EndProcess().  But be very
sure your data is cleaned up.

-David
david@metra.com

-----From: pmcadam@stealth.webo.dg.com (Paula McAdam)

There is a good example on the MSDN, in Technical
Articles:Windows:Networking.  If you do a search on the keywords "NT Service
in C++", you'll see in the query results a topic "Creating a Simple Windows
NT Service in C++".  I hope this helps!

-----------------------------------------------------------------------
Paula McAdam                           Data General Corporation
pmcadam@stealth.webo.dg.com            Enterprise Solutions Engineering




Luca Orlandi -- Luca.Orlandi@inferentia.it
Friday, July 05, 1996


------ =_NextPart_000_01BB6A6B.F1E54500
Content-Type: text/plain; charset="iso-8859-1"




| Вернуться в корень Архива |