Skip to content

Commit

Permalink
[typeinfo.py] Add documentation for QueryPathOfRegTypeLib
Browse files Browse the repository at this point in the history
Like this, we clearly understand that QueryPathOfRegTypeLib can sometimes raises a OSError.
  • Loading branch information
moi15moi committed Jan 26, 2025
1 parent 338c1ea commit 6e6393a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion comtypes/typeinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,25 @@ def CreateTypeLib(filename: str, syskind: int = SYS_WIN32) -> ICreateTypeLib2:
def QueryPathOfRegTypeLib(
libid: str, wVerMajor: int, wVerMinor: int, lcid: int = 0
) -> str:
"""Return the path of a registered type library"""
"""
Retrieve the path of a registered type library.
This function interacts with the Windows registry to locate the path of a
registered type library given its GUID, version, and locale.
Args:
libid (str): The GUID of the type library as a string.
wVerMajor (int): The major version of the type library.
wVerMinor (int): The minor version of the type library.
lcid (int, optional): The locale ID of the type library.
Returns:
str: The path of the registered type library.
Raises:
OSError: If QueryPathOfRegTypeLib fails.
"""

pathname = BSTR()
_QueryPathOfRegTypeLib(
byref(GUID(libid)), wVerMajor, wVerMinor, lcid, byref(pathname)
Expand Down

0 comments on commit 6e6393a

Please sign in to comment.