- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm writing a distributed processing application and would like the remote process to collect information about which machine it is on and pass it back with the results. I thought that the Kernel32 function GetComputerName would handle this and would return the Windows system name as it is defined in Network identification. I'm not having any luck getting it to work though.
INTERFACE
FUNCTION GetComputerName( lpBuffer,nSize)
USE DFWINTY
integer(BOOL) :: GetComputerName
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, &
FUNCTION GetComputerName( lpBuffer,nSize)
USE DFWINTY
integer(BOOL) :: GetComputerName
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, &
ALIAS:'GetComputerNameA' :: GetComputerName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpBuffer
character*(*) lpBuffer ! LPSTR lpBuffer
integer(LPDWORD) nSize ! LPDWORD nSize
END FUNCTION
END INTERFACE
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpBuffer
character*(*) lpBuffer ! LPSTR lpBuffer
integer(LPDWORD) nSize ! LPDWORD nSize
END FUNCTION
END INTERFACE
The windows documentation says that both these arguments should be pointers, but that doesn't match this interface. These appear to be a string and the string length directly. I've tried both variations, but get an "Program Exception - access violation" in all cases. CVF 6.6c on Win2K SP2, if it matters.
I am ready to accept guidance at this point.
Thanks in advance, Cliff
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know why my earlier search didn't turn up this thread, but while waiting I found.....
This has jugoslav's fix as well as Sabalan's workaround.
Thanks to both.
Steve, feel free to delete this redundant thread.
Message Edited by frieler on 12-15-2003 08:21 AM
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page