LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NIReport With ActiveX Big Pb !!!

I'm using the NIReport object to print several results and the DTPicker ActiveX Control in a UIR display to let user choose their date.
I'm using LabWindows CVI 6.0 and Windows2000 (activeX SP4)

When I use those two objects, I have NON-FATAL RUN-TIME ERROR !!
I attach my workspace example to this mail to let you see rapidly the pb.

There are two ways to generate the pb :
1) In my source, if I call the NIReport_New function then the LoadPanel function; the LoadPanel function returns me a NON-FATAL RUN-TIME ERROR with Library function error (return value == -143) <=> ActiveX control error.
2) If I call thirst the LoadPanel then the NIReport_New function (after the DiscardPanel), it returns me a NON-FATAL RUN-TIME ERROR wi
th return value == -4).

Where is the problem ??
I can't print any reports.

Thanks to your answer.
Eddy DUCHENE
12 F Chemin de Boutary
69300 CALUIRE ET CUIRE

educhene@laposte.net
Download All
0 Kudos
Message 1 of 4
(3,391 Views)
OK, so the deal is, these two ActiveX components are both trying to initialize the threading model to something different. LoadPanel is giving an error because it can't initialize to apartment threaded since NI-Reports already initialized. The first error is easy to avoid by calling NIReport_New after calling LoadPanel, or by initializing the thread model yourself at the top of main with:

CA_InitActiveXThreadStyleForCurrentThread (0, COINIT_APARTMENTTHREADED);

As for the second error, I'm not sure why you are seeing that. It could be a problem in the NI-Reports code. We will take a look at it and see if we can fix it. Until then, just don't call the New function after you've discarded all the ActiveX panels.

Best Regards,

Chris Matthews
Nation
al Instruments
0 Kudos
Message 2 of 4
(3,389 Views)
Hi,

I'm also having some problems with NIReports. When I compiled and run on two Win2000 computers - works fine. When I try to run it on Win NT 4.0 (with installed CVI/7.1 run-time) I'm getting an error code -3 from NIReport_New.

Can somebody explain it to me?

Thanks,
Alex Bahel

alex.bahel@coherentinc.com

Message Edited by Alex B on 03-18-2005 07:05 PM

0 Kudos
Message 3 of 4
(3,357 Views)
Hello Alex B,

You may be using different version of NIReports on the different machines. Make sure the NI-Reports files under Program Files\National Instruments\Shared\NI-Reports are the same on the different target machines. Also, which service pack are you using with NT? I would suggest upgrading to SP6, if you have not already done so. If you have a small example program demonstrating the problem, it would be great if you could post that as well.

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 4 of 4
(3,329 Views)