09-23-2008 01:16 AM
Hi, everyone
When i use a dll file in CVI, i have a problem.
Whe i try to run my project, it shows some error message from the uart.h (my dll). As blow picture:
Can anyone tell me how to slove this error ?
Thanks!
This is my project files: http://d.99081.com/a710756/My project.rar
Solved! Go to Solution.
09-24-2008 11:47 AM
Hello a710756,
To use VC++ DLL in CVI, you must make sure that the exported functions in DLL are in C format, not in C++ format.
CVI is not a C++ complier. You may reference to the following discussing link:
http://forums.ni.com/ni/board/message?board.id=180&message.id=721&requireLogin=False
Also, to control COM port, you may reference to example code provided by the NI Example Finder:
09-26-2008 06:43 AM
your DLL is fine, the problem lies in uart.h where some identifier are not defined, namely: WORD and CALLBACK.
those are standard windows definition. #include <windows.h> before including "uart.h", and everything will be ok.
(or best: add the include into uart.h).
09-30-2008 03:10 AM
Thanks for AlexandreChen and dummy_decoy,
your suggests are very helpful for me.
Thank you!