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

How to call DOTNET (.NET) DLL when tlbexp.exe (regasm.exe) says 'no types found'

rwg
Beginner
863 Views
I created a little c# project which references a dotnet dll. After referencing this dll I can browse the classes defined in that dll in my c# project. Now I want to use this dll and its classes in a FORTRAN project, but the Module Wizzart fails because tlbexp.exe creates an empty (only 2KBytes) tlb file. regasm /tlb:filename (which can be used if tlbexp.exe isn't available) says that there are no types to register. I think it's because the dll does not contain any COM components and tlbexp/regasm only exports COM components. How can I call such a dotnet dll from FORTRAN?
0 Kudos
1 Solution
Vadim_M_Intel
Employee
863 Views
I guess the only way is to create new COM-Visible "wrapper" for that third party dll.

View solution in original post

0 Kudos
3 Replies
Vadim_M_Intel
Employee
863 Views
Quoting - rwg
I created a little c# project which references a dotnet dll. After referencing this dll I can browse the classes defined in that dll in my c# project. Now I want to use this dll and its classes in a FORTRAN project, but the Module Wizzart fails because tlbexp.exe creates an empty (only 2KBytes) tlb file. regasm /tlb:filename (which can be used if tlbexp.exe isn't available) says that there are no types to register. I think it's because the dll does not contain any COM components and tlbexp/regasm only exports COM components. How can I call such a dotnet dll from FORTRAN?

Your dotnet dll should have [assembly: ComVisible(true)] attribute. Please look at this link: http://support.microsoft.com/kb/828736 It describes how to make assembly to call it from native C++
0 Kudos
rwg
Beginner
863 Views
Thanks for your help. But this solution requires that I can change the dotnet dll. In my case it's a third party dll so I can not change the dotnet dll. The solution also requires to register the dll which is not desired. Is there an other solution where both requirements are not necessary?

0 Kudos
Vadim_M_Intel
Employee
864 Views
I guess the only way is to create new COM-Visible "wrapper" for that third party dll.
0 Kudos
Reply