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 

Re: How to find out if a drive-letter is 'subst' drive and i

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





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



MR wrote:

Quote:
I would prefer a function, which can be used in a real
DOS-application, if there is any...

What a curious request. No version of Builder can create a real DOS
application.

Anyway have you tried calling ScUNCFromLocalPath() to see if the UNC
path sees 'through' the drive substitution?

--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html

Back to top
MR
Guest





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



"Andrue Cope [TeamB]" <no.spam (AT) not (DOT) a.valid.address> schrieb:

Quote:
What a curious request. No version of Builder can create a real DOS
application.

I know, but I wrote a console-tool for BCB, which should also be
compilable by BC50 for creating pure DOS programs (instead of
console-program).

Quote:
Anyway have you tried calling ScUNCFromLocalPath() to see if the UNC
path sees 'through' the drive substitution?

I just tried it with BCB:

char str[256];
SCODE s=ScUNCFromLocalPath("T:\", str, sizeof(str));

with z:\ being set in the DOS-BOX with

SUBST T: C:

but I got a strange message when executing

Either there exists no standard-mail-client or the current mail-client
can't fullfill the messaging reuqest. Please execute Microsoft Outllok
and define it as standard-mail-client. [TRANSLATED]

instead of delivering

"C:\" inside str.

Trying to use this in BC50 results in some compiler-errors when
including mapiutil.h:
pshpack8.h: Error directive: 8-byte-packing is not supported!
I'm not sure it makes sense to dive into trying to get it run, because
this function does not deliver the intended under windows, as shown
above...

~~~~~

I finally found the function

QueryDosDevice()

which really does what I want, but unfortunately only under windows.

Isn't there really no way to get the same under DOS?

~~~~~~

Thanks a lot,

Michael


Back to top
Andrue Cope [TeamB]
Guest





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



MR wrote:

Quote:
Isn't there really no way to get the same under DOS?

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

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.

I think it unlikely that the same C++ code can be used in both Windows
and DOS. Even if it's possible in this particular case it simply can't
hold true in all cases - the two platforms are just too different. More
likely you will need to isolate such platform specific code in a
separate unit and have one such unit for each platform you intend to
target. Organised correctly you will probably end up with the following
(naming convention is up to you):

Plat_DOS.Cpp/.h
Code and declarations for DOS platform.

Plat_Windows.Cpp/.h
Code and declarations for Windows platform.

Platform.Cpp/.h
- #includes one of the above dependant on compiler (#ifdef/#endif)
- Declarations for a standardised way of using the functionality
provided by the Plat_* units.
- Code to translated the standardised public interface into the
correct calls for the platform specific units.

Ideally Platform.Cpp/.h won't contain any significant code just
function call wrappers but that is dependant on how good a job you do
in defining the Plat_* framework.

--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html

Back to top
MR
Guest





PostPosted: Mon Jan 30, 2006 12: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 12: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
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.