07-25-2009 04:22 AM
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.
07-25-2009 12:51 PM
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.
07-25-2009 01:21 PM
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 🙂
07-28-2009 01:22 PM
07-29-2009 03:58 AM
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
07-30-2009 03:57 PM
Thanks Roberto.
08-05-2009 02:11 PM
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
09-16-2009 02:23 AM