There might be some confusion in the API calls and functionality. Peter's
"APIGetWindowsSystemDirectory" could be misleading because there exist two
distinct API functions, one to get the Windows MAIN directory and the other
the Windows SYSTEM directory. Here is a way to see their differences:
Declare Function GetWindowsDirectory Lib "kernel32" Alias
"GetWindowsDirectoryA"
(lpBuffer As String, ByVal nSize As Integer) As Integer
Declare Function GetSystemDirectory Lib "kernel32.dll" Alias
"GetSystemDirectoryA"
(lpBuffer As String, ByVal nSize As Integer) As Integer
Dim szDir As String,
nReturnLength As Integer
OnError GoTo ErrorOccured
szDir = String$(255, " ")
nReturnLength = GetWindowsDirectory(szDir, 255)
szDir=LTrim$(RTrim$(SzDir)) + "\"
note "Windows main directory " + SzDir
szDir = String$(255, " ")
nReturnLength = GetSystemDirectory(szDir, 255)
szDir=LTrim$(RTrim$(SzDir)) + "\"
note "Windows system directory " + SzDir
exit sub
erroroccured:
Note Err()+ " " + Error$()
Jacques Paris
e-mail [EMAIL PROTECTED]
MapBasic-MapInfo support http://www.paris-pc-gis.com
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: September 4, 2002 01:47
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: MI-L Location of Windows Systems directories through MapBasic
Here you go:
Declare Function APIGetWindowsDirectory$() As String
Declare Function GetWindowsDirectory Lib "kernel32" Alias
"GetWindowsDirectoryA"
(lpBuffer As String, ByVal nSize As Integer) As
Integer
'----------------------------------------------------------------------
'APIGetWindowsSystemDirectory
'----------------------------------------------------------------------
Function APIGetWindowsSystemDirector$() As String
Dim szDir As String,
nReturnLength As Integer
OnError GoTo ErrorOccured
szDir = String$(100, " ")
nReturnLength = GetWindowsDirectory(szDir, 100)
szDir = LTrim$(RTrim$(szDir)) + "\"
APIGetWindowsSystemDirector$ = szDir
Exit Function
'-------------------------
ErrorOccured:
Note ERR_ERRORMSG & lf & Error$()
End Function
HTH,
Peter
----------------------------------------------------------------------------
--------------------
Peter Horsb�ll M�ller, GIS Udviklingskonsulent / GIS-Developer
Kampsax A/S - GIS Software & Solutions
Rugaardsvej 55, 5000 Odense, DK
tel: +45 6313 5013, dir:+45 6313 5008, fax: +45 6313 5090
mailto:[EMAIL PROTECTED]
www.kampsax-gis.dk and www.kampsax.dk
Authorized MapInfo Partner & Distributor in Denmark and Norway.
----------------------------------------------------------------------------
--------------------
Se mere om Dansk MapInfo Brugerkonference p�
http://www.kampsax-gis.dk/Default.asp?ID=296
Klik ind p� http://www.kortal.dk og se det hele lidt fra oven!
Check http://www.kortal.dk and have a look at Denmark from above!
----- Videresendt af Peter M�ller/Kampsax - 04-09-2002 07:39 -----
Jeff Spirek
<jeff.spirek@ng Til:
"'[EMAIL PROTECTED]'"
is.com.au>
<[EMAIL PROTECTED]>
cc:
04-09-2002 Vedr.: MI-L Location of Windows
Systems directories through MapBasic
07:02
Hi Listers
Does anyone know the correct code to extract the location of the
windows/systems directory using the API Function GetSystemDirectory .
Regards
Jeff Spirek
NGIS Australia
47 Burswood Road
BURSWOOD WA 6100
Ph (08) 9355 2444
Fax (08) 9355 2722
http://www.ngis.com.au
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 2807
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 2808
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 2813