I'm trying to develop a program for some hardware, which has a
supplied dll written in MS Visual C++. I have read the FAQ at
http://zone.ni.com/devzone/conceptd.nsf/webmain/1D0C73348D50DE5486256FAF00614757
- in particular the last section which describes how the C++
export functions must be declared with extern "C" for proper linking. I
scanned the suppplied dll with Dependency Walker as described on the
page, and the function names are correct and listed as C (not C++).
I can get my program to compile, but as soon as I call any of the
export dll functions, the program crashes with a fatal run-time error -
"priviledged instruction" fault. All of the functions use some port
I/O, ie inp and outp instructions.
I used the supplied .h file to create the .lib dll import library, but
I can't specify the extern "C" in the .h function definitions (syntax
errors - I guess CVI doesn't like "" in definitions).
Any thoughts would be appreciated!