Answered by:
Custom registration with regasm?

Question
-
Hi,
I've got a .NET assembly that I want to expose to a COM client. I've set the necessary attributes, GUID creation, etc, and I can call my .NET assembly from a COM client successfully.
As part of the registration process (I'm using regasm /codebase), I'd like to have some additional custom registry entries created. For example, I'd like to create a custom category as the value of an Implemented Categories subkey of my component's CLSID (e.g. HKCR\CLSID\{My CLSID}\Implemented Categories). I'd also like to create a TypeLib key under HKCR\CLSID\{My CLSID}\TypeLib, and in that TypeLib key set the default value to the GUID of the object's type library.
Is it possible to have additional registry entries created when I register my assembly via regasm?
Thanks,
Notre
Wednesday, April 11, 2012 9:41 PM
Answers
-
Hello Notre,
1. Sounds like you need the ComRegisterFunctionAttribute and the ComUnregisterFunctionAttribute.
2. Please refer to : "Perform Custom Action during Registration of a Managed COM Server" for sample code :
https://limbioliong.wordpress.com/2011/08/30/adding-additional-data-when-registering-c-com-servers/
- Bio.
Please visit my blog : http://limbioliong.wordpress.com/
Wednesday, April 11, 2012 11:59 PM
All replies
-
Hello Notre,
1. Sounds like you need the ComRegisterFunctionAttribute and the ComUnregisterFunctionAttribute.
2. Please refer to : "Perform Custom Action during Registration of a Managed COM Server" for sample code :
https://limbioliong.wordpress.com/2011/08/30/adding-additional-data-when-registering-c-com-servers/
- Bio.
Please visit my blog : http://limbioliong.wordpress.com/
Wednesday, April 11, 2012 11:59 PM -
- Edited by Karel ZikmundMicrosoft employee Thursday, April 12, 2012 4:53 PM Link the links
Thursday, April 12, 2012 10:03 AM -
Perfect Bio - this is exactly what I needed.
Cheers,
Notre
Thursday, April 12, 2012 8:24 PM