Results 1 to 6 of 6

Thread: Does unregistering a TypeLib also unregister its Classes and Interfaces?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,201

    Does unregistering a TypeLib also unregister its Classes and Interfaces?

    If I use the API function UnRegisterTypeLib to unregister a TypeLib, that removes all its TypeLib entries in the registry. But what about the Interfaces and Classes that had also been put into the registry when the TypeLib was registered. Does UnRegisterTypeLib clean up all the other entries that were put into the registry that had been defined within that TypeLib (all the entries for the associated Interfaces and Classes)?

  2. #2
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,772

    Re: Does unregistering a TypeLib also unregister its Classes and Interfaces?

    You can test it with regmon.

    I bet it does not remove anything because registering a typelib does not add interface/coclass registry entries in first place. These are managed by COM server [un]registration i.e. using regsvr32

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,201

    Re: Does unregistering a TypeLib also unregister its Classes and Interfaces?

    Quote Originally Posted by wqweto View Post
    You can test it with regmon.

    I bet it does not remove anything because registering a typelib does not add interface/coclass registry entries in first place. These are managed by COM server [un]registration i.e. using regsvr32
    Interesting. I thought that regsvr32 called DllRegisterServer and DllUnregisterServer in the DLL, and then the DLL simply called RegisterTypeLib or UnregisterTypeLib (and that then those API functions checked the TypeLib for the presence of Interface and CoClass entries and registered them automatically). Is the process of registering Interfaces and CoClasses actually separate from registering a TypeLib?

  4. #4
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,772

    Re: Does unregistering a TypeLib also unregister its Classes and Interfaces?

    > Is the process of registering Interfaces and CoClasses actually separate from registering a TypeLib?

    When you call CreateObject in VB6 it maps ProgID to CLSID and then from CLSID registration loads a DLL where the in-proc server is implemented.

    When you register a TLB which has some coclasses defined how is the CLSID registry supposed to get a DLL where the in-proc server is implemented when there is no DLL (only a TLB) as a parameter?

    cheers,
    </wqw>

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,201

    Re: Does unregistering a TypeLib also unregister its Classes and Interfaces?

    Quote Originally Posted by wqweto View Post
    > Is the process of registering Interfaces and CoClasses actually separate from registering a TypeLib?
    When you call CreateObject in VB6 it maps ProgID to CLSID and then from CLSID registration loads a DLL where the in-proc server is implemented.
    How about when you use the New keyword like like "set MyObj = New SomeActiveXDLLClass" (after selecting the correct DLL in the References dialog in the Project menu) instead of using CreateObject?

  6. #6
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    5,772

    Re: Does unregistering a TypeLib also unregister its Classes and Interfaces?

    Quote Originally Posted by Ben321 View Post
    How about when you use the New keyword like like "set MyObj = New SomeActiveXDLLClass" (after selecting the correct DLL in the References dialog in the Project menu) instead of using CreateObject?
    It's mostly the same CoCreateInstance API behind CreateObject call and New operator (unless calling New on private classes which are not registered in registry) so the same logic applies -- you cannot register coclass's DLL with regtlib.exe as there is no DLL on the command line as parameter.

    cheers,
    </wqw>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width