Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to derive from CNi4882Device

I wrote a class which derives from the CNi4882Device class. It compliles OK, but I get a link error "LNK2001" when I try to build the app. It looks like the problem is in the derived constructor. Is it possible to derive from this class? If so, are there any examples? Thanks in advance.
0 Kudos
Message 1 of 9
(4,273 Views)
You should be able to derive from CNi4882Device. I did a quick test and was able to create a class that derives from CNi4882Device in an MFC application project, compile it, and link it successfully.

Make sure that the application project that uses your derived class has the Measurement Studio Lib directory in the set of directories that it uses to find libraries. You can do this either through the project linker settings or through the Visual Studio environment options settings. What version of Visual Studio are you using?
0 Kudos
Message 2 of 9
(4,273 Views)
Thanks fo the response. The project is setup OK. I can declare a variable of CNi4882Device in my mainframe file and instantiate it like the example in the "Basic Gpib" app, but when I try to use a derived class, I get a linker error. Must be something stupid I'm doing. Could you please post the code for the derived class, and show how to initialize it in an application. Thanks for your help.
0 Kudos
Message 3 of 9
(4,273 Views)
Are you using Visual C++ 6.0 or Visual C++ 2003?
0 Kudos
Message 4 of 9
(4,273 Views)
I am using Visual C++ 6.0.
0 Kudos
Message 5 of 9
(4,273 Views)
See if the attached project works for you. If it gives you a link error, please post the exact error text. If not, let me know what's different between our projects (or post your project) so that I can help brainstorm possible solutions.
0 Kudos
Message 6 of 9
(4,273 Views)
I didn't save the project files before zipping them up. Try the project attached to this post instead.
0 Kudos
Message 7 of 9
(4,273 Views)
Thanks for the help. Your project compiled fine. My error was in the derived class constructor declaration. Now my project builds successfully. Once again, thanks for your help.
0 Kudos
Message 8 of 9
(4,273 Views)
No problem; glad we got it worked out. Post again if you hit additional issues.
0 Kudos
Message 9 of 9
(4,273 Views)