LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can latest version of CVI IDE load classes?

We are developing DLL's to be usable under CVI IDE, using Visual Studio .NET C++ compiler.

I heard a rumor that if we get the latest version of CVI IDE, that our exported C++ classes can be used in the CVI IDE?
- I thought the CVI IDE could only compile C applications?
- I thought the Measurement Studio C++ classes could only be used in MSVC++ IDE? So development HAS to be done in MSVC++?

We want to generate our DLL so our customers using CVI can still use our DLL.
- Do we have to create C-front ends? So C++ classes cannot be used in CVI IDE?
- Should we create COM interfaces, so CVI IDE can use it? (however it is difficult for our customers to program in COM)
0 Kudos
Message 1 of 4
(3,350 Views)
Hello

CVI 7.0 is still an ANSI C only compiler. So it still works in the same way it used to. So your options for using the dlls in CVI would be

a) To use extern "C"
b) To create COM interfaces, and import those interfaces into CVI by using the activex wizard.

COM tends to confuse folks alot more than simple C dlls. Not to mention creating COM components can get pretty hairy sometimes.

So if you are targetting CVI users, usually a C dll with an fp file makes life alot easier, for the client and the developer both.

But CVI is still "C" for Virtual Instrumentation.

I hope this explains things.

Bilal Durrani
NI
Bilal Durrani
NI
Message 2 of 4
(3,350 Views)
Does this mean that I can't use a VC++ dll unless the prototypes are generated with 'extern "C"' flag at the beginning?  Right now, CVI doesn't seem to like the header file with the class definitions.  I wasn't sure if this was because CVI was not installed with C++ configured or because the header file lacked the 'extern "C"' flag.  thanks.

0 Kudos
Message 3 of 4
(3,233 Views)
Yes, you cannot use any exported functions created with a C++ compiler from CVI without using extern "C". This is because a C++ compiler will mangle the exported function name which CVI will not understand. See this document for more information.

You also cannot load any classes in a DLL since CVI is an ANSI C compiler and does not understand classes.

Bilal Durrani
NI
0 Kudos
Message 4 of 4
(3,207 Views)