LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the CVI ActiveX Automation interface from VC to launch CVI?

My platform: WinXP, CVI 6.0, VC++6.0.

I simply add cvisrvr.c,cvisrvr.h to my VC project. But after build it says:
"e:\vcprojects\myproject\cvisrvr.c(2189) : fatal error C1010: unexpected end of file while looking for precompiled header directive"
Then I add "#include "stdafx.h"" to the beginning of cvisrvr.c, but still get error information:
"Compiling...
cvisrvr.c
e:\vcprojects\myproject\cvisrvr.c(1) : fatal error C1853: 'Debug/myProject.pch' is not a precompiled header file created with this compiler
Error executing cl.exe."

When I was using CVI5.0, I added cvisrvr.h, cvisrvr.lib, cvisrvr.dll to my VC project as activex automation server, and it worked fine.

I've studied the sample in C:
\Program Files\National Instruments\MeasurementStudio\CVI\samples\activex\cvi, but still don't know how to use it.

Any help be appreciated!
0 Kudos
Message 1 of 4
(3,317 Views)
I remembered what I did before.
Create a new project with cvisrvr.c and cvisrvr.h, then create release dll, and get cvisrvr.lib, cvisrvr.dll, which seems what I want. Add to my VC project then.
Hope I am right on doing so.

Another question occurs.
From the sample I see that I need to call InitCVIRTE() at beginning, and call CA_DiscardObjHandle at last to release the handle. But how to call these two functions in VC project?

Thanks in advance.
0 Kudos
Message 2 of 4
(3,317 Views)
I just usually turn of the pre-compiled header option in Visual C, since I dont really need it. You can do this by going to the project settings >> C/C++ tab , select Precompiledd Headers from the cetegory drop down list, and select not to use precompiled headers.

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 3 of 4
(3,317 Views)
Hi, Bilal Durrani:

Thanks a lot.

Echo
0 Kudos
Message 4 of 4
(3,317 Views)