DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert cmd_register.odl to tlb file

Dear Colleagues,

 

my problem: In order to become familar with the conversion of *.odl files to *.tlb, I tried to start with the given DIAdem example file CMD_register.odl (see DIAdem Script Help: ScriptCMDRegister).

So I used MIDL.EXE (8.00.0595) and the corresponding cl.exe, both of MS-Vis10.0, to convert the cmd_register.odl file. This resulted to an error message by the midl.exe: command line error MIDL1001 : cannot open input file oaidl.idl.

According to the help on MIDL it should be possible to convert *.odl files instead of *.idl files also. But this seams not to be correct to 100%.
As I do not have a idl-version of this example CMD_register.odl, I wonder if it is possible to get an idl-version of CMD_register.odl from NI, or any information about what else I could do in order to convert the odl to tlb successfully. I need this proceedure for further developments of user command classes for DIAdem VBS.

 

Any help is appreciated!!

 

Thanks a lot in advance and with best regards

0 Kudos
Message 1 of 6
(7,112 Views)

Hi FamSailor,

 

Actually, this is the only thing the DIAdem 2014 Help says about ODL files:

 

"You can use the Microsoft MIDL compiler to convert the ODL file to a TLB file. Refer to the compiler documentation for more information."

 

If you are having trouble with this conversion, please refer to Microsoft for help-- NI does not provide this conversion feature.

 

Regards,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 6
(7,088 Views)

Dear FamSailor,

had the same Problem.

 

Solved it by adding \I-Parameter to the mild.exe-Command line.

The following example works for me, running it in the VisualStudio-Command-Line (called by VsMSBuildCmd.bat):

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\midl.exe" /I "C:\Program Files\Microsoft SDKs\Windows\v7.1\Include" /tlb "M:\DIAdem\CodeCompletion\test.tlb" /mktyplib203 /win32 "M:\DIAdem\CodeCompletion\test.odl"

 

Working on the *.odl-syntax right now.

Any recommondations or some good internet tutorial?

 

Regards

0 Kudos
Message 3 of 6
(5,864 Views)

Dear Christian,

 

many thanks a lot for this valuable information. It is a long time ago when having had this trouble and I solved it with a bad but working work around. With your help now things become easier.

Next time your solution will be the choice.

 

Best regards

0 Kudos
Message 4 of 6
(5,861 Views)

Edit: Sorry, but forgot something in the first post: You need to change your active directory in VS-Command-Line to "<VisualStudioFolder>\VC\bin"

0 Kudos
Message 5 of 6
(5,855 Views)

Hi Christian,

 

one more comment according your question:

>>>>

Working on the *.odl-syntax right now.

Any recommondations or some good internet tutorial?

 >>>>

 

it is more than one year ago, when I was programming a user dll for using it in Diadem VBS. It was a very litle task with much less complexity compared to the complexity of the implementation and the getting startet with the user.dll issue in DIAdem itself. I simply worked strictly according to the NI example. Copied it, renamed it and implemented one function with some in parameters and one return value. It was a lot of trial on error but fianlly it worked and still works. I focused on one on of the example functions that met best my requirements and added / changed according what I needed.

As I remember my biggest problem was how to transfer from the dll to DIAdem. How to do this in detail depends on the type of data transfer you need. But in general I would say with experience: One of the  examples covers more or less your needs. Take the one that covers best your needs implement it and debug it. So you learn how it works and what you have to change in order to solve your problem. so did I and finally succeeded.

 

Hope that helps.

 

0 Kudos
Message 6 of 6
(5,853 Views)