LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write PNG file failed when build exe, but run normally on the development platform

Solved!
Go to solution

 

refer to below picture, it is used to call WinAPI for screen shot, and then save to PNG file. This Vi run normally on the development flatform, but it is failed when build .exe application file. The error dialog pop-up "illegal path string, OS", but it is clear that the path is correct. Note: run the same PC with Win XP.

 

 

screen shot.png

Colin Zhang
------------------
LV7.1/8.2/8.2.1/8.5/8.6/9.0/2010/2011/2013/2015/2016/2020; test system development; FPGA; PCB layout; circuit design...
Please Mark the solution as accepted if your problem is solved and donate kudoes


Home--colinzhang.net: My Blog

iTestGroup: One-step test solution provider!
ONTAP.LTD : PCBA test solution provider!
0 Kudos
Message 1 of 14
(5,784 Views)

Can you attach the screenshot of error dialog that pops up...!!


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 14
(5,770 Views)

Thanks for your reply. Yes, but it is Chinese. I also put the dialog location here. 

 

Error.PNG   Dialog.PNG

Colin Zhang
------------------
LV7.1/8.2/8.2.1/8.5/8.6/9.0/2010/2011/2013/2015/2016/2020; test system development; FPGA; PCB layout; circuit design...
Please Mark the solution as accepted if your problem is solved and donate kudoes


Home--colinzhang.net: My Blog

iTestGroup: One-step test solution provider!
ONTAP.LTD : PCBA test solution provider!
0 Kudos
Message 3 of 14
(5,768 Views)

When i put the dialog before Write PNG File, no error output. 

 

dialog1.PNG

Colin Zhang
------------------
LV7.1/8.2/8.2.1/8.5/8.6/9.0/2010/2011/2013/2015/2016/2020; test system development; FPGA; PCB layout; circuit design...
Please Mark the solution as accepted if your problem is solved and donate kudoes


Home--colinzhang.net: My Blog

iTestGroup: One-step test solution provider!
ONTAP.LTD : PCBA test solution provider!
0 Kudos
Message 4 of 14
(5,766 Views)
Solution
Accepted by colinzhang

Update:

i have found the reason but no solution. In fact, the Clipboard.Get Image is not working when build exe application. But this is the private Invoke Node, can't get any support from NI.

It seems to become to the public Invoke Node on LabVIEW 2012 version, who can help to verify it on LV2012 version? Thanks very much.

Colin Zhang
------------------
LV7.1/8.2/8.2.1/8.5/8.6/9.0/2010/2011/2013/2015/2016/2020; test system development; FPGA; PCB layout; circuit design...
Please Mark the solution as accepted if your problem is solved and donate kudoes


Home--colinzhang.net: My Blog

iTestGroup: One-step test solution provider!
ONTAP.LTD : PCBA test solution provider!
0 Kudos
Message 5 of 14
(5,727 Views)

I have lv2012 and it does not work here either.

Has anyone found a solution?

0 Kudos
Message 6 of 14
(5,613 Views)

No, it seems a bug that has reported to NI R&D. 

Colin Zhang
------------------
LV7.1/8.2/8.2.1/8.5/8.6/9.0/2010/2011/2013/2015/2016/2020; test system development; FPGA; PCB layout; circuit design...
Please Mark the solution as accepted if your problem is solved and donate kudoes


Home--colinzhang.net: My Blog

iTestGroup: One-step test solution provider!
ONTAP.LTD : PCBA test solution provider!
0 Kudos
Message 7 of 14
(5,606 Views)

oooh, Yes, I change to use .Net reference to copy the screenshot. Please visit my blog site for solution.

Colin Zhang
------------------
LV7.1/8.2/8.2.1/8.5/8.6/9.0/2010/2011/2013/2015/2016/2020; test system development; FPGA; PCB layout; circuit design...
Please Mark the solution as accepted if your problem is solved and donate kudoes


Home--colinzhang.net: My Blog

iTestGroup: One-step test solution provider!
ONTAP.LTD : PCBA test solution provider!
0 Kudos
Message 8 of 14
(5,604 Views)

Thx man 😃

0 Kudos
Message 9 of 14
(5,601 Views)

 

I find another solution that get the clipboard image. Hope it is helpful for next follower.

 

Use the IMAQ ClipboardToImage.vi under vision module, it can get the image successfully, but not verify it after build executable file.

 

Refer to below code, 

 

Copy the clipboard to image.png

Colin Zhang
------------------
LV7.1/8.2/8.2.1/8.5/8.6/9.0/2010/2011/2013/2015/2016/2020; test system development; FPGA; PCB layout; circuit design...
Please Mark the solution as accepted if your problem is solved and donate kudoes


Home--colinzhang.net: My Blog

iTestGroup: One-step test solution provider!
ONTAP.LTD : PCBA test solution provider!
0 Kudos
Message 10 of 14
(5,511 Views)