just to clarify ...
From: ZP (zeebee_at_SPAMOUTop.pl)
Date: 01/20/05
- Next message: Jeff Johnson [MVP: VB]: "Re: Catching custom message ..."
- Previous message: Dib: "Re: Date Function"
- In reply to: ZP: "addressing system folders"
- Next in thread: Steve Gerrard: "Re: just to clarify ..."
- Reply: Steve Gerrard: "Re: just to clarify ..."
- Reply: Randy Birch: "Re: just to clarify ..."
- Reply: MikeD: "Re: just to clarify ..."
- Reply: J French: "Re: just to clarify ..."
- Messages sorted by: [ date ] [ thread ]
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
>
>
- Next message: Jeff Johnson [MVP: VB]: "Re: Catching custom message ..."
- Previous message: Dib: "Re: Date Function"
- In reply to: ZP: "addressing system folders"
- Next in thread: Steve Gerrard: "Re: just to clarify ..."
- Reply: Steve Gerrard: "Re: just to clarify ..."
- Reply: Randy Birch: "Re: just to clarify ..."
- Reply: MikeD: "Re: just to clarify ..."
- Reply: J French: "Re: just to clarify ..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|