NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

No function parameter information when calling Borland C++ DLL

I have a DLL that I've created in Borland C++ 5.5 with the following code:

 

extern "C"
{
    void __declspec(dllexport) __stdcall myfun(int * a){*a = - *a; }
}

 

Now when I add this DLL using the C/C++ adapter to my sequence and call myfun(), I get the following message: "This function does not have parameter information in the DLL or uses types not recognized by TestStand."

 

I have also tried creating a similar DLL in MS VC++ but it worked fine. Unfortunately, I have to use Borland C++ because of some legacy code. I don't really know too much about the specifics of how MS VC++ creates DLLs vs Borland but I'd like to figure out how to create a DLL in Borland so that I don't get the error message anymore.

0 Kudos
Message 1 of 5
(4,854 Views)

TestStand gets prototype info from visual studio dlls from the decorated name in the export table. extern "C" however generates an export without the C++ decorated name prototype information. So I'd recommend removing the 'extern "C"' and see if it works. If Borland generates visual C++ compatible decorated names then it should work.

 

Additionally, or if that does not work. You can create a type library in your dll that teststand can use to get the prototype information, however that would be more work and I'm not sure exactly how to do that with Borland C++.

 

-Doug

0 Kudos
Message 2 of 5
(4,841 Views)

I tried to remove the extern "C" and the function doesn't even show up in the drop down list anymore.

0 Kudos
Message 3 of 5
(4,837 Views)

Borland decorated names must not be compatible with Visual Studio then. Probably the only option then is a type library. I'm not sure how or if you can create one with Borland though. Perhaps the following forum thread will be useful:

 

http://forums.ni.com/t5/NI-TestStand/Argument-for-function-not-viewed-able-under-VC-by-teststand/m-p...

 

-Doug

0 Kudos
Message 4 of 5
(4,819 Views)

Have you been able to call the Borland DLL from a different environment besides TestStand? Maybe consider creating a wrapper DLL that calls your DLL from Borland that you have had success calling within TestStand (such as VC++ as you mentioned).

Ian M.
National Instruments
0 Kudos
Message 5 of 5
(4,818 Views)