LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Error-checking function

In the MS Word report example, wordrpt.prj, a command-by-command error-checking function is used. Example:
 
RptChk (WordRpt_ApplicationNew (VTRUE, &appHandle));
 
RptChk is defined as a macro:
 
#define RptChk(f) if (error = (f), FAILED(error)) { ReportActiveXError (); goto Error; } else     
 
When I run the example project, wordrpt.prj, all is well. When I try running the exact same code from within my program, I get the error "Missing prototype" for each instance of RptChk(). I have included the macro in my program. I am using LabWindows/CVI v7.1. Any ideas?
 
Steve
0 Kudos
Message 1 of 3
(3,425 Views)
It means that some argument inside the macro is not defined inside your project.
 
The most easy way to find the statement on error is to disassemble the macro on a line in error and run the projrct. For example:
 
error = WordRpt_ApplicationNew (VTRUE, &appHandle);
if (FAILED(error)) {
  ReportActiveXError ();
  goto Error;
}
 
Either FAILED or ReportActiveXError functions are not defined elsewhere in your project.


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 3
(3,419 Views)

Robert,

You are correct. I was missing ReportActiveXError(). I had not previously used a macro quite like this. Thanks for the help.

Steve

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