LabVIEW Crash Exception 0xC0000005 When Using Type Cast with ActiveX

Updated Aug 30, 2023

Reported In

Software

  • LabVIEW

Issue Details

  • I am calling 3rd party API using ActiveX references. In LabVIEW™, I convert between ActiveX object types using the Type Cast function. This causes LabVIEW to crash. Why?
  • I am trying to cast an ActiveX object to another object but LabVIEW keeps crashing with exception 0xC0000005. How can I prevent this?
  • When I use ActiveX references to interact with 3rd Party API, LabVIEW crashes with the following message:
Exception: Access Violation (0xC0000005) at EIP=0x106A5780
 
Crash Message.png

Solution

This exception indicates that a memory exception has occurred. This will either be due to:
  • Reading memory that doesn't exist. For example, memory that was allocated, freed and then re-accessed.
  • Writing to memory that is null or invalid.
  • Executing in a memory address that does not permit code execution.
To resolve this error, follow the steps below:
  1. If a Type Cast Function is used in LabVIEW, replace this with a Variant To Data Function instead.
    • Type Casting between ActiveX references can result in an attempt to write to empty memory if the references consist of different properties.
  2. Verify that the 3rd party API is the same bit-ness as LabVIEW.
  3. Verify whether the behaviour persist when running LabVIEW as an Administrator.
  4. Generate a .dmp file to determine the exact cause of the crash.