Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Error running managed code inside DllMain or image initialization

I have a LabView 7.1 DLL, and am calling it from a Visual C++ application.  I load the DLL dynamically at runtime using LoadLibrary.  When I call the function, I get this:
 
<mda:msg xmlns:mda="http://schemas.microsoft.com/CLR/2004/10/mda">
  <!--
       DLL 'C:\Program Files\National Instruments\Shared\LabVIEW
       Run-Time\7.1\DNCompInfo.dll' is attempting managed execution inside OS Loader
       lock. Do not attempt to run managed code inside a DllMain or image
       initialization function since doing so can cause the application to hang.
   -->
  <mda:loaderLockMsg break="true"/>
</mda:msg>
 
in the Visual C++ debug window.
 
I have been through the pages on this website about creating LabView DLLs and calling them.  I have also created very small vi's and exported them, but with the same error.  I have uninstalled LabView 7.1, and reinstalled it.
 
Any ideas?
0 Kudos
Message 1 of 2
(5,273 Views)

Hi

 

What version of C++ are you using?

 

If you could you post your small VI and associated code I will have a look at it and see if I can get it running with out any errors.

 

You said you have looked at some help material on the website. Have you tried any of the example pieces of code?

 

Here is a link for one.

Calling a LabVIEW DLL in Visual C++ that Passes Array Handles by Reference

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=D67C2540A4CE3182E034080020E74861&p_...

 

See if you can run this with out any errors if you still get the same error with this please let me know

 

Regards

 

Tim

 

AE NI UK and Ireland

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