howto register only whilst running 
Author Message
 howto register only whilst running

I don't want my server to be launchable - I want it to be only
usable while it is running. So I need to call the register code
when it starts up, eg

            _Module.UpdateRegistryFromResource(IDR_JedmicsObj, TRUE);
            nRet = _Module.RegisterServer(TRUE);

and unregister it when it shuts down, eg

            _Module.UpdateRegistryFromResource(IDR_JedmicsObj, FALSE);
            nRet = _Module.UnregisterServer(TRUE);

but I also need to modify it so that it doesn't list the
LocalServer32 line, I think, to prevent launchability at all.

(I suppose I could modify launch permissions to a NULL DACL, but
that isn't correct in my eyes - it isn't that noone is allowed to launch it,
but rather
that the SCM cannot launch it to be a server - it takes a custom launch that
the
SCM cannot do.)

Can I just remove the LocalServer32 line from the rgs file for the creatable
object ?

(Or will my ignorance up and bite me :))



Wed, 12 Mar 2003 03:00:00 GMT  
 howto register only whilst running
You should call the CoRegisterClassObject function.
It will not update the registry permanently. Your objects will
still be available to clients.

FReD



Quote:
> I don't want my server to be launchable - I want it to be only
> usable while it is running. So I need to call the register code
> when it starts up, eg

>             _Module.UpdateRegistryFromResource(IDR_JedmicsObj, TRUE);
>             nRet = _Module.RegisterServer(TRUE);

> and unregister it when it shuts down, eg

>             _Module.UpdateRegistryFromResource(IDR_JedmicsObj, FALSE);
>             nRet = _Module.UnregisterServer(TRUE);

> but I also need to modify it so that it doesn't list the
> LocalServer32 line, I think, to prevent launchability at all.

> (I suppose I could modify launch permissions to a NULL DACL, but
> that isn't correct in my eyes - it isn't that noone is allowed to
launch it,
> but rather
> that the SCM cannot launch it to be a server - it takes a custom
launch that
> the
> SCM cannot do.)

> Can I just remove the LocalServer32 line from the rgs file for the
creatable
> object ?

> (Or will my ignorance up and bite me :))

Sent via Deja.com http://www.deja.com/
Before you buy.


Fri, 14 Mar 2003 03:00:00 GMT  
 howto register only whilst running

If you want to prohibit remote activation, remove the LocalSystem
account from the list of activators. Your server can be launched
locally this way though.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> I don't want my server to be launchable - I want it to be only
> usable while it is running. So I need to call the register code
> when it starts up, eg

>             _Module.UpdateRegistryFromResource(IDR_JedmicsObj, TRUE);
>             nRet = _Module.RegisterServer(TRUE);

> and unregister it when it shuts down, eg

>             _Module.UpdateRegistryFromResource(IDR_JedmicsObj, FALSE);
>             nRet = _Module.UnregisterServer(TRUE);

> but I also need to modify it so that it doesn't list the
> LocalServer32 line, I think, to prevent launchability at all.

> (I suppose I could modify launch permissions to a NULL DACL, but
> that isn't correct in my eyes - it isn't that noone is allowed to launch
it,
> but rather
> that the SCM cannot launch it to be a server - it takes a custom launch
that
> the
> SCM cannot do.)

> Can I just remove the LocalServer32 line from the rgs file for the
creatable
> object ?

> (Or will my ignorance up and bite me :))



Sat, 15 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Howto: declare a C function that registers a callback in IDL

2. HOWTO: Install/copy COM file, and register it.

3. HOWTO: Register a custom sound with my app?

4. HOWTO: Register a custom sound with my app?

5. HOWTO: register own WINCLASS for CDialog-based windows?

6. Q Registers/Subkeys Howto use?

7. HowTo: Launch default browser from Windows Control running in IE browser

8. Howto debug running ATL component?

9. HOWTO: Send Keystrokes to running Application

10. HOWTO: send some keystrokes to another running application

11. HOWTO: set the Tab title of a PropertyPage in a sheet at Run-time

12. Howto: Update window while long calculation is running?

 

 
Powered by phpBB® Forum Software