LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

using .cpp file to create dll

Hi,
  I have some header files which seems to be written in c++. Can I make a .cpp file in VC++,include these header files, build a dll and call the dll from LV? I know that we can call dll written in C but I want to know whether it will work for .cpp files too.

Thanx & Regards,
Srini.

0 Kudos
Message 1 of 2
(2,948 Views)

You shouldn't have any problems building a dll in VC++ that can be used by any other language. You might need to prevent the C++ compiler from 'name mangling' the functions in the dll by adding: extern "C"  to their definition.

('Name mangling' is the process by which a C++ compiler generates unique internal identifiers for overloaded functions ie multiple functions in a single program which all have the same name but have different parameter lists and/or return types.)

JR

Message 2 of 2
(2,943 Views)