Solved

inherit from Object that inherit from TService

Posted on 2002-07-07
5
287 Views
Last Modified: 2010-04-04
hi
i build a service shell that launch, close and detect when the application was closed (by process list), This shell inherit from TService (Service application wizard).
In my project i use this for 2 application can i do this generic?
i have the following code:

TGenericServiceShell = class(TService)
.
.
and
TMyService = class(TGenericServiceShell)

MyService unit was created by using ‘Service application’ wizard,  I changed the inheritance from TService to TgenericServiceShell, and then when closing the project and load it again i get an error about name missing, the service main form replaced with another one and the service doesn't work.

Thanks,
udi
0
Comment
Question by:udic
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:TOndrej
ID: 7137391
You are trying to use form inheritance (because TService comes with a data module).
In that case, make sure the following is true:

The ancestor unit is part of your project.
The descendant's .dfm begins with 'inherited' keyword instead of 'object'.

You can achieve this at design time with File\New\Other... in your project tab, select ancestor, Inherit.

HTH
TOndrej
0
 

Author Comment

by:udic
ID: 7137806
i didn't success.how can i do this?
0
 
LVL 8

Accepted Solution

by:
TOndrej earned 75 total points
ID: 7138073
What's the problem? Is anything in my previous post unclear? Feel free to ask.
0
 

Author Comment

by:udic
ID: 7138159
sorry
Thank you i success, its work great

thanks alot
udi
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 7138183
I'm glad that it helped you.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now