LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

declare typedef function panel

Hi All,
 
I'm trying to create .fp file from my project.
I have a struct declare in some other file, and I want to redeclare it for the function panel.
 
I've added the following line -
typedef struct ClassData_Rec tTestData;
 
the  full declaration is in some other header (which has included).
 
I still get the following error -
"Unknown data type"
 
any ideas?
 
thanks,
 
Noa


Message Edited by noab on 08-03-2008 11:09 AM
0 Kudos
Message 1 of 4
(3,611 Views)
Noa,
 
I was able to get a project working, with a struct redefinition in my .c file for the Function Panel.  Unfortunately this error is generic so its hard to tell what is causing it.  I would recommend double checking the original definition, trying this same redeclare in the original file to make sure everything works within that file, verifying the include of the header, and making sure we didn't make any spelling/capitalization mistakes.  If these simple things check out then we may have to post a copy of the code for testing, or troubleshoot after gaining some more information.  Hope this helps.
John B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,566 Views)

Hi John,

 

the original declaration of tTestData is in the TS API files - so I don't think the problem is there.

 

I've manage to create the function panel using the redeclaration but now I cannot create a DLL that include the  .fp...

 

I get the following error -

 

"Error Creating  Type Library:

All structs, unions,and enums required by exported functions must

use typedefs in order to create a type library. The struct/union/enum "IDispatch"

does not use such a typedef"

 

is there any way to get tTestData struct from TS without giving it as a parameter to the functions?

 

thanks,

 

Noa

0 Kudos
Message 3 of 4
(3,525 Views)

Noa,

 

I think the problem is tied to the fact that this datatype was not intended to be used in quite this manner.  This post goes into some detail that might be relevant.  Also you might check this article from the CVI help file.  Essentially I think the problem boils down to these types and interfaces weren't quite designed to be used in this manner so we are running into issues because of the strict nature that the type libraries require from us.  I still believe this is possible (I will verify) but we may just have to do some extra coding in order to make our code work with these TestStand types.

John B.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,491 Views)