just to clarify ...

From: ZP (zeebee_at_SPAMOUTop.pl)
Date: 01/20/05


Date: Thu, 20 Jan 2005 15:12:37 +0100

Using an advice from Randy Birch and J. French (thank You gentlemen) I went
for API.
For example purposes I used small Access dbase located in System32 folder.
----------------------------------------
Questions:
--------------
1. Did I do it correctly? (well, it works)

2. Will it work on any (all) Windows based systems?
    (I mean on 95, 98, 98SE, NT 4.0, CE, ME, 2000, XP, 2003S)

3. Are there any dangers and weak spots unvisible to newbe, which may make
app to terminate?

4. Should I make some modifications?

------------------------
code (partial):
------------------------
'API
Private Declare Function GetSystemDirectory Lib "kernel32" Alias
"GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
Long
------------
Private Sub Form_Load()

    Dim sSave As String, Ret As Long 'API

    Command3.Visible = True 'shows if Command3 visible
    '---API-------
        sSave = Space(255)
                    'Get the system directory
        Ret = GetSystemDirectory(sSave, 255)
                    'Remove all unnecessary chr$(0)'s
        sSave = Left$(sSave, Ret)
        DBName = sSave + "\test.mdb"

    '---API-------
-------------------------
end code (partial)

Użytkownik "ZP" <zeebee@SPAMOUTop.pl> napisał w wiadomości
news:csnacm$i4k$1@nemesis.news.tpi.pl...
> I have this question.
> Please help me understand.
> -----------------------------------
> Let's say, during installation, I want to create a folder, say "MyFolder"
in
> one of those system folders:
> --- Windows , or
> --- System32 , or
> --- Application Data Folder, or
> --- Common Files Folder,
> and locate there some file, my application would use less or more
> frequently.
>
> Well, sometimes Windows are not installed on drive C:\ and names of
folders
> (dirs) may vary, so I cannot write down exact path, say:
>
> DBName = "c:\windows\system\MyFolder\anyfile.ext"
>
> Is there a way to make this path relative (do I use right word in
English?),
> or
>
> Is there a way to make this paths "universal", so no matter what type of
> Windows or drive names (letters) my app encounters, it won't turn belly up
> and die.
>
> say:
> DBName = "\WindowsFolder\MyFolder\anyfile.ext" , or
> DBName = "\AppDataFolder\MyFolder\anyfile.ext" , or
> DBName = "\CommonFilesFolder\MyFolder\anyfile.ext" etc ...
>
> ------------------
> thnx
>
>



Relevant Pages

  • Re: printer spooler stops unexpectedly
    ... In which subfolder in system32 should I put it? ... Any suggestions besides reinstalling windows? ... your system and put it in the system32 folder if yours is missing. ... expand spoolss.dl_ spoolss.dll ...
    (microsoft.public.windowsxp.basics)
  • Re: DotNetInstaller.exe
    ... First restart the system to make sure the file is not in use by an installer session which has hung. ... installation to run try to locate mscoree.dll in the system32 folder. ... If you have not installed service pack 1 you can extract the file from your windows CD as follows ...
    (microsoft.public.windowsxp.basics)
  • Windows XP Disinformation
    ... The "winhlp32.exe" file in the system32 folder seems to redirect ... incorrectly. ... I'm showing the following for the two files (Windows XP/SP2): ...
    (microsoft.public.windowsxp.general)
  • Re: ftp from Access: problems
    ... > system32 folder, which by default is in the path. ... >> where windows is installed in the folder WinNT rather than Windows. ... standard XP and Server 2003 installs. ...
    (comp.databases.ms-access)
  • Re: MSCOMCTL.OCX
    ... > for Windows XP and Windows 2000. ... It should be put into the system32 folder, ... Register the one in another folder, ...
    (microsoft.public.vb.general.discussion)