Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29240 Discussions

Using the COM facilities: how to find out the "prog_id"

forall
Beginner
616 Views
Following an illuminating example by IanH on using the COM facilities to execute Matlab commands from Fortran, I am interested in using them on a wider scale.

But I am unsure how in general to find the "programmatic identifier prog_id" to be used in the

CALL COMCreateObjectByProgID (prog_id,idispatch,status)

For matlab it is 'matlab.application.single', but how can I find this out more generally? My current interest is linking to the Intel and Compaq array vizualisers via the COM interface - in particular so that I can run both from both CVF and IVF -built applications (I tried this with APIs and couldnt get them to work across the compilers). I looked thru the help/web on both to no avail..

any helps welcome - thanks in advance, dmitri
0 Kudos
3 Replies
John_B__Walter
Beginner
616 Views
Quoting - forall
Following an illuminating example by IanH on using the COM facilities to execute Matlab commands from Fortran, I am interested in using them on a wider scale.

But I am unsure how in general to find the "programmatic identifier prog_id" to be used in the

CALL COMCreateObjectByProgID (prog_id,idispatch,status)

For matlab it is 'matlab.application.single', but how can I find this out more generally? My current interest is linking to the Intel and Compaq array vizualisers via the COM interface - in particular so that I can run both from both CVF and IVF -built applications (I tried this with APIs and couldnt get them to work across the compilers). I looked thru the help/web on both to no avail..

any helps welcome - thanks in advance, dmitri

You can use the "Tools">>"OLE/COM Object Viewer" to look at all of the COM objects installed on your system. It list information (including ProgID) for each item. The trick may be finding the item you want, because there are a lot of them.

Happy hunting.
0 Kudos
forall
Beginner
616 Views
Quoting - John B. Walter

You can use the "Tools">>"OLE/COM Object Viewer" to look at all of the COM objects installed on your system. It list information (including ProgID) for each item. The trick may be finding the item you want, because there are a lot of them.

Happy hunting.

Thanks for the help!

But I dont see the Tools > OLE/COM viewer under my Tools in VS+IVF. I attach a screenshot. Is there some additional installation option? I have IVF11 and VS2008.

any ideas? thanks in advance
0 Kudos
forall
Beginner
616 Views
Quoting - forall

Thanks for the help!

But I dont see the Tools > OLE/COM viewer under my Tools in VS+IVF. I attach a screenshot. Is there some additional installation option? I have IVF11 and VS2008.

any ideas? thanks in advance

Hmm - I eventually found them under MS Software Development Tools in the Start Menu (whereas in CVF they were indeed under the Tools in the Visual studio). Not that it is critical, but is it possible to add them to the VS Tools Menu somehow?

More importantly though, I was indeed able to determine the progID for a few (relatively simple) modules (I could check by establishing the COM connection via the ProgID).

I did this largely by trial and error (because), and it turned out that (at least for those simple VB modules) it resides in the 4th field of the coClasses array. How general is this location? In my cases the TLB came from a Visual Basic DLL which has Classes, but there are also fields Interfaces and Dispinterfaces - are these relevant for call-by-progID at all?

Finally, when I looked at more complicated modules (matlab), I seemed unable to find a progID string that worked just from the TLB file (all strings seemed to be 'helpstrings'). Is this possible for a TLB, or is the progID always present in the file? Note that for this example (the mlapp.tlb found by IanH, cf http://software.intel.com/en-us/forums/showthread.php?t=66558) he already knew the progID (how, Ian? :-), so I know it exists somewhere - just not sure if it is present in that file.

Since this approach for establishing COM interfaces seems very useful, especially when progID is known, advice would be appreciated!
0 Kudos
Reply