Failed to add UXP message listener from native C++ plugin (Photoshop 2022 SDK)
Hi,
I have an older native C++ plugin built using Photoshop 2022 SDK. I’m trying to communicate with a UXP plugin using PIUXPSuite.
In my native plugin, inside the StartUpPlugin function, I have the following code:
if (!sUxpProcs) {
LOG_TRACE((0, "🔧 [UXP-LISTENER] Acquiring PIUXPSuite for message listening"));
SPErr e = sSPBasic->AcquireSuite(kPSUXPSuite, kPSUXPSuiteVersion1, (const void**)&sUxpProcs);
if (e != kSPNoError) {
LOG_TRACE((0, "❌ [UXP-LISTENER] Failed to acquire PIUXPSuite: %d (0x%08X)", e, e));
} else {
LOG_TRACE((0, "✅ [UXP-LISTENER] PIUXPSuite acquired for listening: %p", sUxpProcs));
// Get plugin information using available SPBasicSuite methods
LOG_TRACE((0, "🆔 [PLUGIN] Plugin Reference: %p", gPlugInRef));
// Add UXP message listener
SPErr listenerResult = sUxpProcs->AddUXPMessageListener(gPlugInRef, UXPMessageHandler);
if (listenerResult == kSPNoError) {
LOG_TRACE((0, "✅ [UXP-LISTENER] UXP message listener added successfully"));
} else {
LOG_TRACE((0, "❌ [UXP-LISTENER] Failed to add UXP message listener: %d (0x%08X)", listenerResult, listenerResult));
}
}
}When I build and run Photoshop with my plugin, I get the following error:
Additional context:
The UXP plugin is loaded using UXP Developer Tools.
Photoshop version: 26.11.0.
OS: macOS.
I am trying to set up a listener so that the UXP plugin can send messages to my native plugin.
Questions:
1. Is it valid to add a UXP message listener while the UXP plugin is loaded via Developer Tools?
2. Could the error 0x50214664 indicate a registration issue with the manifest ID?
3. What is the recommended folder/setup for making C++ ↔ UXP messaging work reliably on macOS?
Thanks in advance!
