Powerbuilder Application Execution Error R0035

Here’s a comprehensive review of the PowerBuilder Application Execution Error R0035, including what it means, common causes, symptoms, and step-by-step troubleshooting solutions.


Step-by-Step Diagnostic Process

Before fixing, you must diagnose. Follow this checklist when you see R0035.

Scenario A: Timing Issues with Close or CloseWithReturn

If you attempt to access a window or control after the window has started the closing process, R0035 will occur.

  • Example: You trigger an event on a window from a timer or another thread, but the user closes the window before the event executes.
  • Fix: Check if the object is valid before accessing it.
    // Incorrect (Causes R0035 if w_my_window is closing)
    w_my_window.st_status.Text = "Done"
    

    // Correct if IsValid(w_my_window) then w_my_window.st_status.Text = "Done" end if powerbuilder application execution error r0035

Preventive Measures: Avoiding R0035 in Future Releases

| Strategy | Implementation | |----------|----------------| | Use Relative Paths | Never hardcode C:\ or \\server\ in project library lists. | | Automated Build Scripts | Use PowerBuilder ORCA (Open Runtime Call Interface) to compile from CI/CD pipelines and verify all PBDs are generated. | | Pre-Launch Health Check | Write a small utility that checks file existence, size (>0 bytes), and version stamp before launching main EXE. | | Shadow Copy Deployment | Deploy new version to a new folder, then update a symlink. This avoids "file in use" errors and missing PBDs during cutover. | | PBD Merging | For final production builds, merge all PBDs into one or two large PBDs. Fewer files = fewer chances for R0035. |


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: Example: You trigger an event on a window

  1. 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., GetUserInfo is different from getuserinfo).
    • Paste that exact name into your PowerBuilder FUNCTION declaration.
  2. Check the Declaration Syntax:

    • Ensure the LIBRARY clause points to the correct file name.
    • Ensure the parameter types match the DLL's expectations. For example, passing a String when the DLL expects a Long pointer will crash the call.
  3. Check DLL Location:

    • Is the DLL in the application directory? If not, is it in the Windows System folder or the PATH environment variable?

Root Causes of Error R0035

Let’s break down the technical reasons behind this error.

9. Check for registry issues

  • For older versions (PowerBuilder 10–12), check:
    HKEY_LOCAL_MACHINE\SOFTWARE\Sybase\PowerBuilder\12.5\Runtime
    
  • Ensure RuntimeRoot and DLLPath are correct.
  • For newer versions (2017+), use Appeon’s deployment tools.

3. Deploy all required files

Ensure the following files are present in the application directory:

  • .exe
  • .pbd (PowerBuilder dynamic libraries) or .dll (if using PBDs)
  • .pbr (if used)
  • Required runtime DLLs (e.g., pbvm125.dll, pbrtc125.dll, libjcc.dll, etc.)

How to diagnose (step-by-step)

  1. Note the exact module name in the error dialog (if shown).
  2. Check application folder and deployment package for that module.
  3. Use Dependency Walker (depends.exe) or Dependencies (modern fork) on the app EXE and on the named DLL to find missing transitive dependencies.
  4. Verify 32-bit vs 64-bit: ensure app and DLL bitness match.
  5. Temporarily disable antivirus or check quarantine logs to ensure DLL not blocked.
  6. Check Windows Event Viewer (Application/System) for related errors.
  7. If module is an OCX/DLL COM component, confirm it is registered:
    • regsvr32 "path\component.dll" (run elevated for system directories).
  8. Search for referenced modules in PATH and current working directory. Use Process Monitor (ProcMon) to trace file-not-found attempts.
  9. If module is in GAC or system folder, ensure correct installation of runtime frameworks (e.g., MSVC runtime, .NET, PowerBuilder Runtime Packager components).