Hi Thomas and 'tst',
Ooops, you are right that the 'uType' should be U32 and not I32. The confusion comes from the MessageBox.vi that uses I32 to avoid a coercion dot, since the "MessageBox Type" Listbox can only be a I32. Sorry!
Apart from this, I figured out what the issue was. Originally I was able to reproduce the error with your executable. I noticed that the "user32.dll" was being copied to the "data" folder when building your VI into an executable. Since your VI was supposed to point at the DLL in the "C:\WINDOWS\SYSTEM32\" folder, I deleted the DLL in the "data" folder. From that point onwards, I didn't receive the error anymore.
I tried building the "MessageBox.vi" into an executable and noticed that a "data" folder wasn't created, hence no copy of the user32.dll. After some investigation, it turns out that the reason that the DLL is not copied, is because the DLL is not being specified by path in the Call Library Function Node - only the name "user32.dll" appears where it in your VI specified "C:\WINDOWS\SYSTEM32\user32.dll". Specifying the complete path will result in the DLL being added to the "data" directory when the VI gets build to an executable. Refer to
this other thread about the same issue.
Therefore, to make a long store short, you have two options to fix your VI/executable:
- Workaround: After creating the executable, delete the user32.dll from the "data" directory. Your executable will now spend some time searching for the DLL every time you launch the executable. Fix this by adding the "C:\WINDOWS\SYSTEM32\" folder to "Tools >> Options... >> Paths >> VI Search Path" of the executable. This will result in an added line in the *.ini file.
- Fix: Use only the name of the DLL in the Call Library Function Node by deleting the path (see info in the above link). This will result in no copy of the DLL being created when building the application.
Thomas, I hope this solves your issue on your system too. Please let me know if you have any questions, thanks.
- Philip Courtois, Thinkbot Solutions