Hi, just added some Printf's to Mixer code and found that when RegisterApplication() & UnregisterApplication() the appID I get next time I execute Mixer it increases +1 the previous appID.
As I UnregisterApplication(), shouldn't next time the same appID be used, as it is "disposed"/freed by UnregisterApplication()?
From the application autodoc, RegisterApplicationA, Results:
appID - 0 if application registration failed, otherwise an
application ID (== handle) is returned.
An application ID is always unique and is guaranteed to be
*notreused after an application unregistered itself.
The "REGAPP_UniqueApplication" will cause the registration to fail if another instance of the same app is already running.
LyleHaze wrote:From the application autodoc, RegisterApplicationA, Results:
appID - 0 if application registration failed, otherwise an
application ID (== handle) is returned.
An application ID is always unique and is guaranteed to be
notreused after an application unregistered itself.
As I UnregisterApplication(), shouldn't next time the same appID be used, as it is "disposed"/freed by UnregisterApplication()?
No. AppIDs are assigned incrementally with each RegisterApplication(), and are never reused until reboot. This is to prevent applications from possibly talking to "the wrong addressee". Imagine that as part of a routine, "App 1" repeatedly calls SendApplicationMsg() to communicate with "App 2". Now if "App 2" unregistered and its appID got reused, "App 1" would suddenly send messages to an app that doesn't expect them.