Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

NiVision does not support delayload functionality

I'm writing a C++ application in VisualStudio 10 using NI Vision and NI IMAQ.

 

Depending on the configuration of the deployed application it may not need NI Vision at all.

 

In order to keep a user from requring NI-Vision on their system if the application does not use it I add the NI-Vision DLL to  the Delayload inputs of the project.

 

This way a user can run without a message that the NI-Vision DLL is missing if they never require it.

 

The trouble is, as soon as the "nivision.h" is included, when the application shuts down, it appears to make a call to imaqCloseWindow which will cause an exception if nivision.dll is not present.

 

The exception happens in the generated code __delayLoadHelper2 while looking for imaqCloseWindow

This appears to be called from __tailMerge_nivision_dll()

 

I suspect this is an issue with this line in nivision.h #pragma comment(linker, "/INCLUDE:_nivision_startup_shutdown")

 

Is there anyway to get around this?

 

Thanks,

Amaury

 

 

0 Kudos
Message 1 of 3
(2,965 Views)

Hi,

 

First I just want to point out that none of our vision software is made to be compatible with VisualStudio 2010.  The latest version we support is VisualStudio 2008.

 

That being said, I do not see any way to get around this with out actually editing the DLL.  As you said, anytime you include the nivision.h you are going to have the call to imaqCloseWindow present.

 

Regards,

 

Greg H.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,960 Views)

Have you tried just editing the nivision.h file you are including to remove the linker pragma? I suspect (but do not know for sure) that most functionality will still work correctly. There may be certain initialization that doesn't happen (but might just get lazilly done on first Vision call) as well as things that don't clean up properly (but your process is exiting, so it might not matter) but there seems to be a good chance most functionality will still work correctly.

 

Eric

0 Kudos
Message 3 of 3
(2,954 Views)