 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
server Guest
|
Posted: Mon Jan 30, 2006 5:00 pm Post subject: How to find out if a drive-letter is 'subst' drive and if ye |
|
|
message unavailable |
|
| Back to top |
|
 |
MR Guest
|
Posted: Mon Jan 30, 2006 5:00 pm Post subject: Re: How to find out if a drive-letter is 'subst' drive and i |
|
|
| Quote: | There is probably an interrupt function to do that or else some
in-memory structure you can examine but DOS is..well...old
|
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
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
|
Posted: Mon Jan 30, 2006 5:51 pm Post subject: Re: How to find out if a drive-letter is 'subst' drive and i |
|
|
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
|
Posted: Mon Jan 30, 2006 6:47 pm Post subject: Re: Mapping a network drive on Windows and Linux |
|
|
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 |
|
 |
|
|
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
|
|