LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

IDL file that compiles with MIDL from the command line but won't from CVI.

I am looking for a way to get CVI to acknowledge that the IDL file was compiled externally so it will finish creating the app. I've tried the three different versions of MIDL (and MIDLC) on my computer and two of the three will compile it fine. I tried just replacing the MIDL compiler in the CVI SDK directory and I still get the 2026 error.Is there a way to force CVI to use the another compiler and include path? I'm using CVI 6.0.
0 Kudos
Message 1 of 8
(4,829 Views)
Hi,

CVi uses the Microsoft MIDL compiler, so in general if you can compile it in the command line with Microsoft's compiler there should be no problem doing it with the integrated tools in CVI.

I don't think CVI will allow you to use an external MIDL compiler since in genral it is not needed. Is there any specific reason for using an external compiler? what errors do you get when using the CVI compiler?

Keep me posted.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 8
(4,828 Views)
All I know is the error I mentioned before, 2026. The main reason for the external compiler is as I mentioned, the internal one complains and the external one doesn't.
0 Kudos
Message 3 of 8
(4,828 Views)
CVI uses the Microsoft MIDL compile. Have you tried CVI's MIDL compiler with your IDL file? is this file generated by the ActiveX wizard?
0 Kudos
Message 4 of 8
(4,828 Views)
I modified the IDL to include a file of enums, it seems that the current directory isn't included in the path used for MIDL compilation. If I put the file in the directory with the other IDL files (I don't like this one) or if I install the contents of the include into the IDL (I don't like this either, too easy for a maintenance programmer to miss the modification) it compiles fine with any version of the MIDL compiler on my computer. How do you change the include path to add the current project directory for the MIDL compiler?
0 Kudos
Message 5 of 8
(4,829 Views)
Hi,

It's not common to modify the CVI generated IDL file, however I see why you would need to do it. As for your questions "How do you change the include path to add the current project directory for the MIDL compiler?" I don't know of the top of my head how to do this; but I'll do some research and I'll let you know what I can find.

Juan Carlos
0 Kudos
Message 6 of 8
(4,828 Views)
Hi,

I have some more info on this, CVI will not allow you to add additional paths for the MIDL compiler. There are a couple of things that you can try out:

1) When you include the additional file in the idl file, try providing it with a fully qualified path to the idl file.

2) You can use an external compiler to create the compiled midl file ( a tlb file ), and use the VC resource editor to embed his tlb file into the CVI projects resource file. This file is in the build folder for and has an res extension

There is somthing to watch out for, the IDL file generated by the CVI wizard could be reganareted if you run the wizard again; this could delete all you changes. The file has a warning along those lines.

I hope
this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 7 of 8
(4,828 Views)
#1 is problematic as the code needs to be able to be compiled on a different machine and I can't guarentee the next programmer will have the same setup. I tried a relative path but it didn't like it.
If I do #2, how do I get CVI to acknowledge that the IDL file has been compiled? Does it look at the .RES file and compare the dates?
0 Kudos
Message 8 of 8
(4,829 Views)