LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to open pdf file in CVI

Hello to all,

 

  Please help me regarding my problem, I am newbie in CVI.

I got some error while trying to execute my program. And here is the error

"NON-FATAL RUN-TIME ERROR:   "SpecsViewer.c", line 60, col 5, thread id 0x00000330:   Library function error (return value == -3 [0xfffffffd])."
 

Please take a look on the attached file.

0 Kudos
Message 1 of 8
(6,390 Views)

Here some hint to help you address your problem.

 

If you look in the online help for LaunchExecutable, you can see that return code -3 stands for "File not found": the online help for the command specifies that you must pass a complete pathname of the executable to launch, so creating the complete path and filename string of the Adobe Reader should solve the problem. This will work if you know exactly the position of the executable in every computer where your application is intended to run.

 

Being a newbie as you said, you shoul take the habit of reading the online help that clarifies several questions you may have in using CVI functions; another hint that can help you is to add error checking to critical functions, basically checking the return values of them: I have published a document on error checking that can give you a framework to develop your personal strategy to handle program errors.

 

 

Having said that, CVI offers you an alternative method to address your question that solves both the problem of different position of the Adobe Reader and the one of a different pdf reader installed on some computer: you can use OpenDocumentInDefaultViewer from the Programmer's Toolbox, a function that automatically solves all the passages needed to open your PDF documen in the default viewer installed in your system, whichever is it.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 8
(6,378 Views)

Hi Roberto,

 

The link you referred in your post is not quite readable.

Neither the pdf version.

Do you have a formatted (with real paragraphs, etc) softcopy of this document. I'd like to read it sometime.

 

Thanks 🙂 

S. Eren BALCI
IMESTEK
0 Kudos
Message 3 of 8
(6,377 Views)
Somehow the carriage returns \r or new line \n have been filtered out from that document..
0 Kudos
Message 4 of 8
(6,324 Views)

Hi Eren and Ray,

I know that document is confused and not so easy to read... I will try to correct it in the next weeks. I will keep you informed.

 

Have a good day

Roberto



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 8
(6,302 Views)

Thanks Roberto.

 

0 Kudos
Message 6 of 8
(6,274 Views)

One of the problems I see is lack of double backslashes. ANSI-C requires backslashes in strings to be backslashed (same for doublequotes).

So the dirpath and pdf_dir1 variables need an extra slash.

 

Another problem lies in trying to execute a specific program to open a document. Instead of having to worry about the program and its actual location, it would be easier to let the system handle it. That can be done by calling function ShellExecute() and passing ONLY the full path to the document. The system will open the document in the associated viewer/editor. For a PDF file, that would be an Acrobat Reader, by default.

 

Hope this helps.

LDP 

0 Kudos
Message 7 of 8
(6,217 Views)
I update this thread just to inform you that I have revised my document about error checking: it should be more readable now.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 8 of 8
(6,026 Views)