LabWindows/CVI is an ANSI C development environment only and does not support the C++ programming language. Neither of the methods you mention, #import (which is a C++ specific preprocessor for creating classes out of type libraries) or extern "C" {...} (which merely allows you to specify a calling convention for another module's function implementations and doesn't really give you access to a dlls functions anyway) are suitable for accessing the supposed ActiveX Interface residing in your dll from within CVI or a C compiler in general. The dll will have to act as a "registered" ActiveX Automation Server and define the implementation of a COM object that can be referenced through its 'clsid' and 'iid's via the underlying COM system in Windows. Another option you could investigate is creating C style function wrappers for the objects defined in the dll, but this would require alot of work on your part and there is actually a feature in CVI that can help you get around this assuming the dll is a valid automation server.
CVI has an Activex Automation library that basically allows you to do COM object access/manipulation in C fairly easily, and it also has an ActiveX Automation Controller Wizard that allows you to select a registered Automation Server on your system and can automatically create a set of functions that specifically access objects unique to that server.
As far as COM specific programming issues go though, we do not provide technical support for this and if you require more information on this topic you can go to the following website for definitive information:
Link -> http://msdn.microsoft.com/library/
Just search for the Windows SDK information on COM, OLE, ActiveX, and OLE/ActiveX Automation.
For information on how to use the ActiveX Automation Controller Wizard you can look through the documentation of the LabWindows/CVI User Manual around page 3-48, and the ActiveX Automation Library is covered in the LabWindows/CVI Standard Libraries Reference Manual. We also have several online documents/tutorials for CVI that include additional information about this topic at the following link:
Link -> http://digital.ni.com/public.nsf/web/lastweek/D984CF1CA889B809862565FC0078E964?OpenDocument
You can also look at some of the examples in your cvi\samples\activex directory to see how this is implemented with some common applications such as Word, Excel, and Internet Explorer (this is automation involving an .exe, but it can also be done with a dll).
So in short you should look at all of the above references to determine what your dll is actually capable of in terms of use in CVI.
Jason F.
Applications Engineer
National Instruments
www.ni.com/ask