Powerbuilder Application Execution Error R0035 __exclusive__ -
In PowerBuilder, the Application Execution Error R0035 is a runtime error defined as "Error calling external object function." It typically occurs when a PowerScript tries to execute a method or function on an external object—usually an OLE (Object Linking and Embedding) or ActiveX control—and the call fails. Common Causes
The error is rarely about the PowerScript code itself and usually points to environment or registration issues:
Unregistered OLE/ActiveX Controls: The specific .ocx or .dll file for the control being called is not registered on the target machine.
Missing Dependencies: The external object relies on other system files (like specific Visual C++ Redistributables) that are not present.
Object State Issues: The external OLE server may have crashed or "died" in the background before the function could be called. powerbuilder application execution error r0035
Pathing Problems: The application cannot find the required DLL because it is not in the same directory as the executable or in the Windows System path.
Bit-Alignment Mismatch: Trying to call a 16-bit DLL from a 32-bit application, or a 32-bit DLL from a 64-bit application. Troubleshooting and Solutions
Register the Control: Use the Windows Command Prompt (as Administrator) to manually register the required file: Command: regsvr32 "C:\Path\To\YourControl.ocx"
Verify Object Initialization: Ensure the OLE object is correctly instantiated (using CREATE or ConnectToObject) before calling its functions. In PowerBuilder, the Application Execution Error R0035 is
Check for Missing Files: Use tools like Dependency Walker to see if the external object is missing any required system libraries.
Implement Exception Handling: Wrap the call in a TRY...CATCH block for OLERuntimeError to capture more detailed information about why the call is failing without crashing the app.
Full Rebuild: If the error occurs after an upgrade, perform a Full Rebuild or Regenerate the objects in the PowerBuilder IDE to ensure all ancestor/descendant hierarchies are correctly compiled.
For more technical support, you can search for similar cases on the Appeon Community Q&A or the SAP Technology Q&A forums. PowerBuilder Application Execution Error R0035! Incorrect Parameters: Passing a string by value when
3. External Function / API Calls
If your application calls external DLLs (Windows API calls), R0035 occurs if the function signature in PowerBuilder does not match the actual DLL function, or if the DLL could not be loaded.
- Incorrect Parameters: Passing a string by value when the DLL expects a reference (pointer).
- Corrupted Stack: Passing too many or too few arguments can corrupt the memory stack, leading to an immediate R0035.
- Fix: Review your
Function ... Library "dllname.dll"declarations. Ensure data types (Long vs ULong, String vs Blob) are correct.
7. Disable antivirus temporarily (for testing)
- If the error disappears, add the application folder to the antivirus exclusion list.
Scenario A: Calling a DLL (Local External Functions)
If you are declaring a function in the "Local External Functions" section of a painter and calling it, follow these steps:
-
Check Case Sensitivity:
- Open your DLL in a tool like Dependency Walker (depends.exe) or PE Explorer.
- Find the exact function name.
- Copy the name exactly as it appears (e.g.,
GetUserInfois different fromgetuserinfo). - Paste that exact name into your PowerBuilder
FUNCTIONdeclaration.
-
Check the Declaration Syntax:
- Ensure the
LIBRARYclause points to the correct file name. - Ensure the parameter types match the DLL's expectations. For example, passing a
Stringwhen the DLL expects aLongpointer will crash the call.
- Ensure the
-
Check DLL Location:
- Is the DLL in the application directory? If not, is it in the Windows System folder or the PATH environment variable?
How to Fix Error R0035
How to diagnose (step-by-step)
- Note the exact module name in the error dialog (if shown).
- Check application folder and deployment package for that module.
- Use Dependency Walker (depends.exe) or Dependencies (modern fork) on the app EXE and on the named DLL to find missing transitive dependencies.
- Verify 32-bit vs 64-bit: ensure app and DLL bitness match.
- Temporarily disable antivirus or check quarantine logs to ensure DLL not blocked.
- Check Windows Event Viewer (Application/System) for related errors.
- If module is an OCX/DLL COM component, confirm it is registered:
- regsvr32 "path\component.dll" (run elevated for system directories).
- Search for referenced modules in PATH and current working directory. Use Process Monitor (ProcMon) to trace file-not-found attempts.
- If module is in GAC or system folder, ensure correct installation of runtime frameworks (e.g., MSVC runtime, .NET, PowerBuilder Runtime Packager components).