LabWindows™/CVI™ Programs Linking to Mixed-Mode DLLs Crash
Primary Software Version: 2009
Primary Software Fixed Version: N/A
Secondary Software: N/A
I am writing a program in LabWindows/CVI, and I need to statically link against a mixed-mode DLL. However, when I do this, my program crashes with the following error:
FATAL RUN-TIME ERROR: Unknown source position, thread id ...: A non-debuggable thread caused a 'General Protection' fault at address...
How can I statically link to a mixed-mode DLL without crashing my application?
This crash occurs because of the order in which the LabWindows/CVI linker writes imported function information to the imports section of the final executable. LabWindows/CVI 2010 and later exposes a method for changing this order. To fix the crash mentioned previously, LabWindows/CVI must write the imported function information for mixed-mode DLLs before all other DLLs. Complete the following steps to enforce the order in which LabWindows/CVI writes this information:
KnowledgeBase 37AF2I86: LabWindows/CVI Application Fails to Execute on Windows XP Service Pack 2 with Remote Execution Security Enabled
Developer Zone Tutorial: Calling a DLL in CVI: Explicit Linking vs. Implicit Linking (Dynamic vs. Static)
Report Date: 09/30/2010
Last Updated: 03/17/2015
Document ID: 5DTDHRXU