Since R0035 is a runtime error that crashes the application, you should wrap your external function calls in a TRY-CATCH block to handle the error gracefully and get more info.
OLEObject lole_myobj
Integer li_result
lole_myobj = CREATE OLEObject
li_result = lole_myobj.ConnectToNewObject("MyApplication.Control")
IF li_result <> 0 THEN
MessageBox("Error", "Could not create object: " + String(li_result))
RETURN
END IF
TRY
// This is the line causing R0035
lole_myobj.MyFunction("Parameter1")
CATCH (RuntimeObjectError err)
MessageBox("External Object Error", &
"Error calling MyFunction: " + err.getText() + "~r~n" + &
"Error Number: " + String(err.Number))
FINALLY
lole_myobj.DisconnectObject()
DESTROY lole_myobj
END TRY
If you want to avoid runtime PDB lookups entirely, compile all objects into the EXE using a PBR file. This increases EXE size but eliminates R0035.
In the PowerBuilder IDE:
Maintain a manifest file (app_versions.txt) that lists MD5 checksums for each PBD. At startup, the loader computes the hash and compares. If mismatch or missing, trigger an auto-update or clear error message. powerbuilder application execution error r0035
R0035 means the bridge between PowerBuilder and the outside world is broken. 90% of the time, it is a registration issue (OCX not registered) or a Name Typo (Case sensitivity in the function name).
Missing or Unregistered Components: The required library (DLL, OCX, or VBX) is not registered on the system or is missing from the application path.
Automation Timeout: The OLE procedure call took longer than the internal timeout period (default is 5 minutes). If the request is expected to be long, the default may need adjustment. Since R0035 is a runtime error that crashes
Initialization Issues: Attempting to call a function on an object that has not been properly instantiated or connected via ConnectToNewObject.
State Errors: Calling a specific function when the object is in an invalid state, such as trying to print an image before one has been loaded. Resolution Steps
Register the Component: Manually register the relevant control using regsvr32 (e.g., regsvr32 mscomct2.ocx). If you want to avoid runtime PDB lookups
Adjust Timeout: Use the SetAutomationTimeout function to lengthen the allowed wait time for OLE calls if the server is slow.
Verify Object Connection: Ensure the OLEObject variable is successfully connected to the target application or control before calling its methods.
Debugging: If the cause is unclear, advanced users can use WinDbg to attach to the PowerBuilder process and capture the call stack at the moment of failure.
Are you seeing this error with a specific OLE object, such as Excel, Crystal Reports, or a custom ActiveX control? PowerBuilder Application Execution Error R0035!