//*************************************************************** // From the book "Win32 System Services: The Heart of Windows 98 // and Windows 2000" // by Marshall Brain // Published by Prentice Hall // // Copyright 1995, by Prentice Hall. // // This code gets the remote name of a connection. //*************************************************************** // drvgc.cpp #include #include void main() { DWORD result; char name[256]; DWORD bufferSize = 256; // Change the drive letter as appropriate result = WNetGetConnection("h:", name, &bufferSize); if (result == NO_ERROR) cout << name << endl; else cout << "Error: " << result; }