BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to find out if a drive-letter is 'subst' drive and if ye

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
server
Guest





PostPosted: Mon Jan 30, 2006 5:00 pm    Post subject: How to find out if a drive-letter is 'subst' drive and if ye Reply with quote



message unavailable
Back to top
MR
Guest





PostPosted: Mon Jan 30, 2006 5:00 pm    Post subject: Re: How to find out if a drive-letter is 'subst' drive and i Reply with quote



Quote:
There is probably an interrupt function to do that or else some
in-memory structure you can examine but DOS is..well...old Smile

Yes, probably that's what I'm looking for...

Quote:

There's usually some way of doing what you want but whether it's
documented or supported by a given development platform is another
matter.

Well, I didn't mean that my source would not contain some special
conditional-processor. Indeed I'm using

#if DOES_RUN_UNDER_PURE_DOS
...
#else
...
#endif

And, naturally, I try not all my projects to run under DOS Wink
But this one, which supports programming a batch-file is useful in the
rare cases of running under DOS too.

~~~~~~~~~~

Again: if someone knows how to get the subst-assignment under DOS
(interrupt, etc.), please let me know.

Thank you,

Michael
Back to top
Steven J Masta
Guest





PostPosted: Mon Jan 30, 2006 5:51 pm    Post subject: Re: How to find out if a drive-letter is 'subst' drive and i Reply with quote



MR wrote:
Quote:

Again: if someone knows how to get the subst-assignment under DOS
(interrupt, etc.), please let me know.

A quick look at Ralf Brown's Interrupt List
http://www.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/WWW/files.html or
http://www.ctyme.com/rbrown.htm (indexed html version with search) shows
INT 0x21 AH=0x60 might be what you want for a DOS only program.

Steve
Back to top
Michael Gillen
Guest





PostPosted: Mon Jan 30, 2006 6:47 pm    Post subject: Re: Mapping a network drive on Windows and Linux Reply with quote

Bono wrote:

Quote:
I'm writing a CLX (multiplatform) Application and I need to connect to a
remote network
machine (I know the IP address).
Does anybody know how can I map a network drive? Is it going to work on both
(windows and linux) platforms?

This snippet of code works mapping to a network drive - Windows or Samba.

// We can map via IP address or system name
if(CbxUseIP->Checked)
RemoteName = "\\\\"+EdtIpAddress->Text+AnsiString(ShareName);
else
RemoteName = "\\\\"+EdtComputerName->Text+AnsiString(ShareName);
// An avilable drive letter was selected
AnsiString DriveName = CbxAvailDrives->Text.c_str();
NETRESOURCE nr;
DWORD dwFlags;
ZeroMemory(&nr, sizeof(nr));
nr.dwType = RESOURCETYPE_DISK;
nr.lpLocalName = DriveName.c_str();
nr.lpRemoteName = RemoteName.c_str();
dwFlags = NULL;
if(CbxRemember->Checked)
dwFlags = dwFlags | CONNECT_UPDATE_PROFILE;

Screen->Cursor = crHourGlass;
int rc;
rc = WNetAddConnection2(&nr,EdtPasswd->Text.c_str(), EdtUserName->Text.c_str(), dwFlags);
Screen->Cursor = crDefault;
if(rc != NO_ERROR)
{
// A special message for this
if(rc == ERROR_BAD_NETPATH)
MessageDlg("The network path cannot be found.", mtError, TMsgDlgButtons() << mbOK, 0);
else
GetLastErrorStr( rc );
return false;
}

--
-Michael Gillen
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.