Re: Program doesn't when user changed

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



It is it a matter of style, but might I make the small suggestion you take
the code in the example and place it in a 'class'.

Then create methods to accomplish specific tasks or services. That way all
the 'ugly' constants, API calls, etc are hidden from view in one convenient
place.

ex:
' to return the full path of your data file
Public Function MyDataFullPath( ByVal sDataFileName As String) As String
' to return the fullpath for a specific user storage
' using a hardcoded data file
Public Function UserDataFullPath()
' fonts
Public Function AllFonts() As String

-ralph


"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:YKqdnQ7U4Nn63MDeRVn-pQ@xxxxxxxxxxxxxxx
>
> "Wyne" <Wyne@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:D89690AA-EB94-4452-9FC8-9EB5C6916FEE@xxxxxxxxxxxxxxxx
> > Ralph,
> >
> > I couldn't find the corresponding API declaration from my VB6 API
Viewer.
> I
> > think I need update some text file. Can tell me how to do?
> >
> >
>
> I am sure there is. I don't use an API viewer. (Preferring a typelibrary
and
> help). Is this the old one built-into VB6? It uses the "..Visual
> Studio\Common\Tools\WinApi\Win32Api.txt", which you can edit, but there
are
> some other updated viewers available on the web. Just do a quick Google.
>
> Heres one...
> http://www.devx.com/vb2themax/CodeDownload/19774
>
> I don't use them, so hopefully someone will come back with a better
answer.
>
> -ralph
>
> >
> > "Ralph" wrote:
> >
> > >
> > > "Wyne" <Wyne@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > news:FB151F12-45C4-4FC5-A00C-284F5FF02B92@xxxxxxxxxxxxxxxx
> > > > Thank you Ralph,
> > > >
> > > > Can you tell me which API (and the constant) to use?
> > > >
> > > > Thanks.
> > > >
> > > > "Ralph" wrote:
> > > >
> > >
> > > http://www.mvps.org/access/api/api0054.htm
> > >
> > > > > "Wyne" <Wyne@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > > > news:C24BFCF0-0404-482E-AF4D-05010F12C20A@xxxxxxxxxxxxxxxx
> > > > > > Thank you very much for reply. I have found out the cause:
> > > > > >
> > > > > > When this program first time runs, it create some files in
> > > C:\MySettings,
> > > > > > stores some information in folder. Everytime it runs, these
> > > infromation
> > > > > will
> > > > > > be updated. When run this software from other other account,
these
> > > files
> > > > > > refuse to be updated.
> > > > > >
> > > > > > How can I fix this problem? Can I make the C:\MySettings to be
> > > accesiable
> > > > > to
> > > > > > all users?
> > > > > >
> > > > > >
> > > > > >
> > > > > > "vbexp" wrote:
> > > > > >
> > > > > > > Most likely something like this:
> > > > > > >
> > > > > > > Dim rs As ADODB.Recordset
> > > > > > > rs.CursorLocation = adUseClient ' Generates an error
> > > > > > >
> > > > > > > When it should be like this:
> > > > > > >
> > > > > > > Dim rs As ADODB.Recordset
> > > > > > > Set rs = New ADODB.Recordset
> > > > > > > rs.CursorLocation = adUseClient
> > > > > > >
> > > > > > > In the first example, rs is Nothing or Null, so you get the
> error.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Wyne" <Wyne@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > > > > > news:1F91775B-60E1-4A14-BFF5-9E844F2DBFC5@xxxxxxxxxxxxxxxx
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > I have an App made using VB6. A customer installed it in his
> XP
> > > > > machine
> > > > > > > > form
> > > > > > > > Admin account. Then he allow other users access it from
normal
> > > account
> > > > > > > > (they
> > > > > > > > are of Power User type). Then, the program shows "Runtime
> error
> > > 91:
> > > > > Object
> > > > > > > > variable or With variable not set."
> > > > > > > >
> > > > > > > > Accoeding to the customer, this program runs well from Admin
> > > account.
> > > > > > > >
> > > > > > > > It doesn't use registry access commands, such as "Save
> Setting,
> > > Load
> > > > > > > > Setting". But it uses two user controls.
> > > > > > > >
> > > > > > > > Can anyone tell me what are potentential causes and how to
> > > debug/fix?
> > > > > > > >
> > > > > > > > Thanks in advance.
> > > > > > > >
> > > > >
> > > > > You can't.
> > > > > (Or shouldn't. Select your own degree of "don't do this" if you
want
> to
> > > be
> > > > > Windows compliant. <g>)
> > > > >
> > > > > Windows provides four 'safe' places your application can use for
> shared
> > > > > data -
> > > > > "Program Files\<vendor>\myApp"
> > > > > "Program Files\Common\<vendor>\myApp"
> > > > > "Documents and Settings\All Users\Application Data\<vender>\myApp"
> > > > > "Documents and Settings\All Users\Local Settings\Application
> > > > > Data\<vendor>\MyApp"
> > > > >
> > > > > All these places can be found using 'Special Folder' apis.
> > > > >
> > > > > -ralph


.



Relevant Pages

  • Re: PInvoke Marshalling....
    ... The wParam is a pointer to a API defined structure (containing a Low DWORD ... contents of the string builder. ... "DeviceHandle" and not indicative that it is a windows handle. ... public static extern int SNAPI_SetVersionBuffer(IntPtr DeviceHandle, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Find path to outlook.exe
    ... an API to get it may be a slight bit more reliable. ... "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, _ ... Public Function fGetOutlookEXE() As String ... Dim RetVal As Long ...
    (microsoft.public.access.modulesdaovba)
  • Re: Find path to outlook.exe
    ... "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, _ ... Public Function fGetOutlookEXE() As String ... Dim RetVal As Long ... this API apparently can take version specific arguments as ...
    (microsoft.public.access.modulesdaovba)
  • Re: szPname As String * MAXPNAMELEN (How to declare)
    ... This should gives me 168 as length of structure mxl which is "MixerLine" ... It doesn't include the string variables. ... I am also using following API function which fills detail of mixer control ... > Be aware that VB6 declarations are not going to be valid for most API ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Problem with passing parameter
    ... > 1) Your declare for WriteFile is incorrect. ... Since you're using strings you'd alias this API with an "A". ... > 2) You can *not* pass a variant, even if it's type is string, to an API ...
    (microsoft.public.vb.general.discussion)