LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling VB6 ActiveX DLL with Run-time Error '406' Non-modal forms cannot be displayed in the host application from an ActiveX DLL.

I am developing the new LabVIEW Vision application which is about displaying the video file. I do have several DLL's, they are ActiveX DLL and were developped by Visual Basic 6.0. 

 

I can call each functions of the ActiveX DLL by using Automation Open and Invoke Node but there is one function (initialize), LabVIEW reports the error "Error '406' Non-modal forms cannot be displayed in the host application from an ActiveX DLL, ActiveX Control, or Property Page. 

 

I have a look on this DLL Source code and found that this function is to show the VB form with SetWindowPos function by calling User32.dll from Windows and this may cause an Error 406.

 

This function can show the VB form if I call it by VB6, but in LabVIEW, error 406 is appeared. 

 

My guess is that SetWindowsPos function is to show the VB form as non-modal forms. If we call from VB6, it would be okay as VB6 will be act like a Parent form but it cannot find the Parent form under LabVIEW.

 

My guess might not be correct, this is just my reseach over the Internet few days.

 

Can anyone suggest me how to solve this problem? I have attached the snapshort VI and error appeared. I can give you more information about the ActiveX DLL if you needed.

 

 

Regards,

Eddy

0 Kudos
Message 1 of 3
(3,846 Views)

Dev123,

 

 I did a bit of digging and I'm pretty sure you're right on the issue. There is a Microsoft article that I've linked here. In my opinion, the registry edits might be the best way to resolve this but will change aspects of your Operating System so should be used with caution.

 

 

Regards,

Ali S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(3,761 Views)

Thank you, Ali

 

That is very useful answers but the error still insists, then we decided to use another solution which is not VB6 ActiveX DLL anymore to avoid further errors. 

0 Kudos
Message 3 of 3
(3,466 Views)