Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting host name and mounting drives 1

Status
Not open for further replies.

oinky

Programmer
Oct 29, 2001
45
US
Hi in visual c++, how do you find out the hostname of the machine that the code is running on? Also is there a way to mount a network drive through c++? i am on an NT4 sp6a system. Thanks in advance.
 
>. find out the hostname of the machine that the code is
>> running on

BOOL GetComputerName( LPTSTR, LPDWORD)

>> is there a way to mount a network drive

Are you asking about mapping the drive?

NET_API_STATUS NetUseAdd (
LPWSTR UncServerName,
DWORD Level,
LPBYTE Buf,
LPDWORD ParmError
);

Hope this helps
-pete
 
Thanks! the GetComputerName function works great
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top