NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Error when creating a DLL with type library

I am trying build a DLL with type library, which make it possible to get Teststand to display arguments of the selected function. However I encountered a problem when building with long error message shown as below.Also I attached my project. "Error generating type library. Mktyplib.exe failed while compiling the odl file used to create the type library. Note: The error indicates that the odl file has unknown types. This error is possible when functions with non-standard types are exported using the export qualifier method from files in release configuration that have not been recompiled during the build process. You can mark all files for recompilation and repeat the build .To avoid this situation, it's recommended that you export these functions using the include file method. You can save the odl file and then use the odl file with the command line: "c:\program files\national instruments\cvi71\sdk\bin\mktyplib.exe"/win32/nocpp/tlb?load bin_dbg.tlb""c:\documents and settings\kzjfr0\desktop\load bin project\load bin_dbg.odl" to see what error s mktyplib.exe reported. Do you want to save the odl file now? Appreciate your help. Jacky
0 Kudos
Message 1 of 5
(3,237 Views)
Your function panel specifies the type of the Sequence_Context parameter as CObjHandle, but it should be CAObjHandle.
 
By the way, starting with CVI 7.1 and TestStand 3.1 you do not need a type library for TestStand to load parameters automatically. Just make sure you declare your exported functions with the __declspec(dllexport) modifier as in the following code:
 
void __declspec(dllexport) fun(void)
{
}
 
or
 
void DLLEXPORT fun(void)
{
}
0 Kudos
Message 2 of 5
(3,210 Views)
I changed the name to CAObjHandle, and it can be built. However, it still can not automatically get Teststand to display arguments of the selected function, with message" This function does not have parameter information in the DLL". Then I refer to article of "Embedding Type Libraries in LabWindows/CVI for Teststand DLL Steps" (http://digital.ni.com/public.nsf/websearch/BCB57B5F7E0D292486256BFA005DAD92?OpenDocument) and found I have ignored one step "then attach your DLL as the source for the .fp instrument driver. ". I don't know what's the meaning of this sentence and how to do?
 
 
"
Solution: To include a type library in a DLL built in LabWindows/CVI you simply have to create an instrument driver .fp file that contains function panels for each of the functions that you want to export from your DLL.

If you already have a DLL created you can simply create a new .fp file in CVI, creating a function panel in that .fp file for each of your exported functions, and then attach your DLL as the source for the .fp instrument driver.
"
Thanks!
0 Kudos
Message 3 of 5
(3,199 Views)
I was making fool of the understanding on "then attach your DLL as the source for the .fp instrument driver", Now I understand it, however, I still can not get Teststand to display arguments of the selected function.
 
Sorry about that and hope you can help me.
Jacky
0 Kudos
Message 4 of 5
(3,191 Views)
  By accident, I made success that I can get Teststand to automatically display arguments of the selected function, but until now I don't know why.
  Even I have two completely the same projects, including same building setting, they behavior different results. The only difference between them is the size of .fp files.
 I really don't know how can this happen!
 
 In the attached file, "Load Bin Project" works fine and "Load Bin ProjectPPP" does not work.
 
Regards!
Jacky
Download All
0 Kudos
Message 5 of 5
(3,188 Views)