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

MAC-ID

steinigen
Beginner
401 Views
Hi,

I have to read the Mac-ID of the network interface card. One solution is "ipconfig /all >a.txt" and then read the number from "a.txt". My question is, if there is a more elegant solution to get the mac-id number.

Yours sincerely
Frank

0 Kudos
3 Replies
james1
Beginner
401 Views
See this article.

James
0 Kudos
steinigen
Beginner
401 Views
Hi James,

thank you for the information. I want to translate the code from C to CVF. I found the NCB structure in dfwinty.f90 (T_NCB). My problem is, how should I call the 'Netbios' function. I found this function only in the library 'netapi32.lib' and this is a library with C-functions. Have anywhere a example, where I can see how I have to call the Netbios function from CVF?

Thanks Frank
0 Kudos
Jugoslav_Dujic
Valued Contributor II
401 Views
Add the following code to your header:
INTERFACE
   INTEGER(1) FUNCTION Netbios(NCB)
   !DEC$ATTRIBUTES STDCALL, ALIAS: "_Netbios@4":: Netbios
   USE DFWINTY, ONLY: T_NCB
   !DEC$ATTRIBUTES REFERENCE:: NCB
   TYPE(T_NCB):: NCB
   END FUNCTION
END INTERFACE
...and, of course, specify netapi32.lib in project settings.

Most of libs in VC98/Lib are not "C-function libraries", but import libraries for system dlls, accessible from both VC++ and CVF. The problem is that all C headers are not translated to Fortran (DFWIN & friends) by Compaq, so, from time to time, you have to roll your own.

Jugoslav
0 Kudos
Reply