NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

vc++ dll problem in teststand

Solved!
Go to solution

 

I have a third party DLL most probably developed in VC++. I have even .h and .lib files for that DLL. I want to investigate how this DLL can be integrated in TestStand. The issue is that when using C/C++ adapter the TestStand finds only one function in that DLL and it seems to be like Class::Function. I tried to find a solution in this forum, but it seems that solutions have access to DLL source code.

 

I'm familiar developing DLLs in CVI and using them in TestStand. Is that my only method to program in CVI a core to that DLL if I want to use it in TestStand ? If I would like to communicate with third party provider, what they should add to DLL in order to get it work in TestStand ?

 

regards,

petri

 

0 Kudos
Message 1 of 7
(4,706 Views)

Hi Petri,

 

Have you ever looked on the examples that are shipped with TS ?

You should take a look on  \Examples\AccessingPropertiesUsingAPI\UsingMFC\AccessingPropertiesAndVariables.seq

 

I suppose when you place your DLL function

A Message will Popup "This function either does not have parameter information ....."

 

If this right, you have to place the arguments manually in TS

you have the h. file, so this should be not difficult.

 

 

Hope this helps

 

juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 2 of 7
(4,695 Views)

Hi Petri,

 

Before you do the upper stuff

you should examine you dll with the Tool "Dependeny Walker

You can download it at http://dependencywalker.com/ .

With it you can look "inside" your dll

 

If you see only one function so TS will do it, too 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 3 of 7
(4,692 Views)

Hi Juergen,

Thanks for tips regarding the dependencywalker. That's a nice tiny program, I would have had use for it before. I looked into the DLL in question and dependencywalker finds the functions listed in .h file so far I understood it. It also reports of two missing DLLs linked into DLL.

 

So in TestStand, I have had problem before with error message you write with an other third party DLL, but not this time with this DLL. Because TS doesn't find the functions except one in the DLL, I tried to manually configure function name with its parameters according to dependencywalker for another function than that TS finds. When running seq file TS complains about that it could not find the function. Configuring that function in TS, which TS finds automatically, I'm able to run the seq without errors.

 

When looking closer in to the DLL with dependencywalker I find out that the only function TS finds is a function which returns void (in .h file defined as static void), others are returning e.g. unsigned int (in .h file defined as virtual unsigned int). 

 

BTW, the DLL is publically downloadable from http://www.dektec.com/Products/Apps/DTC-302/Downloads/SpRcApi.zip

 

Best Regards,

Petri

 

0 Kudos
Message 4 of 7
(4,673 Views)
Solution
Accepted by topic author Petri

Hi,

 

I looked on the dll. TS do it right. Because the GetVersion is the only one public and static function inside your class.

this dll is providing a class. I think you have to write your own wapper-dll around it. You have to create the object in side our wrapper. Then must create some wrapper functions where you access the class members.

 

hope this helps

 

juergen

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 7
(4,668 Views)

thanks Juergen,

I was afraid I have to program my own core for that DLL...

Best regards,

Petri

 

0 Kudos
Message 6 of 7
(4,664 Views)

I am using the DTC302 with the SOAP interface from Delphi. That works without using the DLL with which you struggle. I suppose that the DLL could be easily used from a Visual C++ development environment. Other compilers ... may have trouble ...

0 Kudos
Message 7 of 7
(3,926 Views)