LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

"IDispatch Error"

I am trying to get CVI to add type Library resorce to the DLL. However when the compiler tries to create the DLL I get a "IDispatch does not use such a typedef" error. I think it has something to do with the tTestdata and tTestError structures.How can this be corrected?
0 Kudos
Message 1 of 5
(3,836 Views)
Yes, unfortunately, these structures (tTestData, tTestError) were not designed to be exported to VB type information. What is happening is that the interface structure IDispatch is not typedef'd, so CVI doesn't know how to convert it to a COM data type.

These data types were designed to be used with the CVI flexible adapter in TestStand, NOT through ActiveX calling which is where type libraries come in handy. The only way it would be possible to get this type library to build would be by editing the TestStand Adapter include files to replace the IDispatch type with a basic pointer that you could cast back to a DISP pointer later. This would be very ugly and not very useful though.

Bottom line, these structures were designed for C use and there is a
separate interpretation of these structure for ActiveX use with the ActiveX adapter in TestStand.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 5
(3,836 Views)
The code that I was trying to create the DLL from was a "CVI C" code instrument driver that contained a fp and used the tTestData and tTestError . ( see example file)

My intent was to access the a DLL function that contained tTestdata and tTestError from the Teststand Flexible DLL Prototype adapter.

Therefore I would need the DLL built with the type library resource.

However it also seems that it is not possible or extremley difficult to call a function (that contains tTestdata and tTesterror) in a DLL, with the Flexible DLL Prototype Adapter?

Thanks.
0 Kudos
Message 3 of 5
(3,836 Views)
What I was saying is that these structure are specifically designed for use with the C/CVI flex adapter. They CANNOT be represented in COM datatypes without a lot of work, therefore, it is very difficult to put them in a type library DLL. You shouldn't have any reason to use these datatypes from the DLL adapter though. They are designed to pass CVI specific information that it can use to communicate with TestStand and provide integration between the environments.

Why are you trying to do this? Is there a reason you are using a CVI flex adapter function with the DLL flex adapter?

Chris
0 Kudos
Message 4 of 5
(3,836 Views)
I'm having this same problem.

We have a DLL that was originally written to use the CVI Standard Prototype Adapter. But I don't like that adapter anymore. We're going to migrate all of our functions to Flexible Prototype Adapter (and then eventually to Visual C++... eventually.)

For now, I just want to write any new functions using the Flexible Prototype Adapter. So, the DLL will contain a mix of CVI Standard functions, and Flexible Prototype functions.

For the Flexible Prototype Adapter, we need a type library. The CVI adapter doesn't.

I don't really understand how this problem is happening. When I enable the type-library the CVI, I have to specify a .FP file, from which the type-library is built. I thought only the fun
ctions I put in the .FP file would get into the type-library. The functions with the CVI Standard Prototype aren't in the .FP file, so why are they relevant when the type-library is built?
0 Kudos
Message 5 of 5
(3,836 Views)