Re[5]: ATL 7.0 Service не работает
От: DavidTelAviv  
Дата: 30.05.04 06:24
Оценка:
Здравствуйте, spacecraft, Вы писали:

Sorry for this _Module stuff, I got it in old project based on ATL3.
Hold on.
Why you are using CAtlExeModuleT as base? Shouldn't it be CAtlServiceModuleT which is in turn deriverd from CAtlExeModuleT?!
I got very similar problem with class reg. I deleted service entries in registry and deleted DCOM config entry and that helped in my case. It's something messy in COM class entries in registry I guess.



S>Здравствуйте, DavidTelAviv, Вы писали:


S>Nope. This is not suitable. ATL 7.0 does not support _Module global variable anymore. There is _pAtlModule variable declared as:


S>
S>__declspec(selectany) CAtlModule* _pAtlModule = NULL;
S>

S>Anyhow, RegisterClassObject function defined in CAtlExeModuleT template, and what I can do is to call it in the next form:

S>
S>hr = CAtlExeModuleT<CMyService>::RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED);
S>

S>But result is the same. So, how come Microsoft put this call in PreMessageLoop function of CAtlExeModuleT template, if a service can be started without it? Also, will a service be operable without the call?

S>


S>Mikhail




DTA>>Здравствуйте, Аноним, Вы писали:


DTA>>And if you try this :

DTA>> hr = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER, REGCLS_MULTIPLEUSE);
DTA>>?
DTA>>In fact ATL template calss calls registration.


А>>>Здравствуйте, DavidTelAviv, Вы писали:


А>>>msvcrt71d.dll exists in system32 folder.


А>>>I found why services could not be started. The function below returns code 1:


А>>>
А>>>hr = RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE | REGCLS_SUSPENDED);
А>>>

А>>>If I comment the row, the service starts successfully. Otherwise, it sucks. Anyway, I'd like to know why is that? Is it Microsoft issue, or mine?

А>>>Mikhail



DTA>>>>Здравствуйте, spacecraft, Вы писали:



DTA>>>>Check if you have this one in sys32: MSVCR71d.dll MSVCRT.dll., perhaps some more. Your machine lacks some runtime files.

DTA>>>>David

S>>>>>Hello All!


S>>>>>Такая проблема.


S>>>>>Работаю на Win2k Advanced Server. Забацал новую службу в VC++ 2003. Сгенерировал мастером ATL 7.0 каркас, скомпилировал, зарегистрировал (запустил .exe с ключем /Service). Пробую стартовать службу из консоли Service Control Manager'а и получаю отлуп в MessageBox весьма пространного содержания:


S>>>>>Could not start blah-blah-blah service on Local Computer.

S>>>>>The service did not return an error. This could be an internal Windows error or an internal service error.
S>>>>>If the problem persists, contact your system administrator.

S>>>>>Во всей этой истории напрягает больше всего то, что каркас службы сгенерированный в VC 6.0 запускается сразу же, а то что делает мастер ATL 7.0 из VC 2003 -- не работает. Вероятно, требуется какая-то доработка этого каркаса. В MSDN про такие фишки ничего нет. Может подскажет кто-нить, где тут собака порылась?


S>>>>>Спсиб.
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.