From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 2010 crash when calling user32.dll

Solved!
Go to solution

Interesting LabVIEW 2010 "feature" I discovered this morning.

 

Attached are two identical VIs, one saved in 2010 and one saved in 2009.  These VIs were specifically written to demonstrate the bug I stumbled upon this afternoon.  Each VI when run should allow you to find a specific program (window) open in Microsoft Windows and bring it to the foreground.  It relies on "user32.dll" to perform this operation.  It also allows you to specify the calling convention for the function call.

 

In LV 2009, either calling convention works, without error.  However, in LV 2010 the calling convention for the function must be "stdcall (WINAPI)" and not the default "C".  If the calling convention is "C" then LabVIEW crashes and closes without warning.

 

If you happen to have both LV 2009 and LV 2010 on your computer, I would love to hear if this phenomenon is duplicated so that I can pinpoint whether the bug is LV 2010 related or is more specific to my personal setup.

 

Thanks,

 

~David

Download All
0 Kudos
Message 1 of 5
(3,237 Views)

There has been several instances of this documented over the last few weeks as we all are migrating over to 2010.  This has something to do with the fact that previous versions of LabView fixed issues in calling convention that are not checked (due to compiler optimization in 2010, at least the current explanation) in 2010 and cause a crash.  I guess this is not really a bug but an inconvenience.  I will post links if I find them.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 5
(3,216 Views)
Solution
Accepted by topic author OrbisDavid
221113

Return
CLFN with the wrong calling convention may siliently crash LabVIEW.
LabVIEW 8.5 through 2009 could adjust the calling convention at run time if the user selected the wrong option. In 2010 this no longer happens. More information is found in KnowledgeBase 59KB14WI

Workaround: Use the correct calling convention

Reported Version: 2010 32-bit    Resolved Version: N/A    Added: 07/23/2010

 

From 2010 release notes.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 3 of 5
(3,214 Views)

Thanks for the response Paul.  Glad to see it's a known issue.  Rather unfortunate that it yields a silent and complete LabVIEW crash, but at least now I understand why and the workaround is simple .

0 Kudos
Message 4 of 5
(3,209 Views)

Thank you David!

 

I was experiencing the same issue from LV8.5 to LV2011. You saved my butt!

Only wish I had seen this an hour ago.

 

0 Kudos
Message 5 of 5
(2,374 Views)