By using the following, for example, instead of "Hard coding" file names
mapinfo.do "open table """ & PREF1 & """ interactive"
You may get around the problem. To set these variables I try one of two
things
1 - Set settings in registry
2 - Write to an INI file which you can store in the "system root"

1/
Have a look in the VB help on SaveSettings and GetSettings

'To output information as part of a set preferences dialog
SaveSetting "property", "Options", "OrantHome", Pref1.Text
SaveSetting "property", "Options", "UserName", Pref2.Text
SaveSetting "property", "Options", "UserBusinessUnit", Pref3.Text

'To input information to your app
InPref1 = GetSetting("property", "Options", "OrantHome", "C:\Orant\")
InPref2 = GetSetting("property", "Options", "UserName", "UserName")
InPref3 = GetSetting("property", "Options", "UserBusinessUnit", "Business
Unit")

2/
I have to admit I haven't used it in VB but in MB the Syntax would be as
follows:-
(VB and MB have generally the same approaches so the VB syntax won't be that
much different but you may have to do an "API call" to find the system root)

'To output information as part of a set preferences dialog
open File homedirectory$()+"\INIFILENAME.ini" for output as #1
                Print #1, Pref1  
                Print #1, Pref2
                Print #1, Pref3
              Close File #1
                End if
'To input information to your app
if FileExists(homedirectory$()+"\INIFILENAME.ini") then
        open file homedirectory$()+"\INIFILENAME.ini" for input as #1
        Line input #1, Pref1
        Line input #1, Pref2
        Line input #1, Pref3
close file #1


Tim Chinchen (IT Services) 
mailto:[EMAIL PROTECTED]



Initial Question:-

> I did an MI integrated mapping using Visual Basic. I specified a drive
> name as in  D: to look 
> for the MI tables. I using InstallShield 5.0 to create setup files for the
> VB application. How do you give flexibility for users to install 
> on any drive they want and yet able to read the table files without hard
> coding it in VB.
> 



**********************************************************************
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they   
are addressed. If you have received this email in error please notify 
the system manager.

This footnote also confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.

www.bournemouth.gov.uk
**********************************************************************


----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to