Export (0) Print
Expand All

IMsgrSessionManager::RegisterApplication Method

[RegisterApplication is no longer available in Windows Vista. See Windows Messenger for more information.]

Registers an application for use with a Messenger client.

Syntax

HRESULT RegisterApplication(
  [in]  BSTR bstrAppGUID,
  [in]  BSTR bstrAppName,
  [in]  BSTR bstrAppURL,
  [in]  BSTR bstrPath,
  [in]  LONG ulFlags
);

Parameters

bstrAppGUID [in]
BSTR

BSTR that specifies the GUID of the application. Maximum character length is 39.

bstrAppName [in]
BSTR

BSTR that specifies the application name. Maximum character length is 256.

bstrAppURL [in]
BSTR

BSTR that specifies the URL from which the application can be downloaded. Maximum character length is 256.

bstrPath [in]
BSTR

BSTR that specifies the absolute path to the application's executable. Maximum character length is 260.

ulFlags [in]
LONG

LONG that specifies the flag. This value should always be 0, otherwise this function returns E_INVALIDARG.

Return Value

HRESULT

Returns one of the following values.

Return codeDescription
S_OK

The application was registered successfully.

E_INVALIDARG

One of the parameters passed to the method was not valid.

SR_APP_ALREADY_REGISTERED

The application you are registering has already been registered. (See the following Remarks section).

REGDB_E_WRITEREGDB

The method failed to write the information to the registry.

E_FAIL

The absolute path to the application cannot be resolved or an application with this GUID is already registered.

 

Remarks

Attempting to register an application with a GUID already registered for use with a Messenger client returns SR_APP_ALREADY_REGISTERED.

After registering an application, if you want to re-register it to update any of its parameters (bstrAppName, bstrAppURL, bstrPath, or ulFlags) except for bstrAppGUID, you need to unregister the application first. For example, if you have an application already registered with bstrAppName set to someFile.exe and the next version of someFile.exe takes command line arguments such as someFile.exe /s, which you want to use with a Messenger client, you must unregister the application before re-registering it, assuming the bstrAppGUID did not change. However, if you specify a different bstrAppGUID that is unique and not in use by any other application, you are not required to unregister the application first.

The following table lists the error codes returned by this method.

Error CodeMeaning
0x80004005The session information cannot be retrieved due to a catastrophic error.
0x80070057One of the parameters passed to the method was not valid.

 

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Product

Messenger 4.5

Header

Msgrpriv.h

IDL

Msgrpriv.idl

DLL

Msgsc.dll

See Also

IMsgrSessionManager
UnRegisterApplication
SESSION_RESULT
Messenger Session Invite and Messenger Private APIs
Messenger Lock and Key API

 

 

Send comments about this topic to Microsoft

Build date: 6/30/2010

Community Additions

ADD
Show:
© 2014 Microsoft