CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2001
    Location
    Singapore.
    Posts
    7

    GetSetting / SetSetting

    Hi There,

    I have a silly problem at hand. I am using the GetSetting and SetSetting functions to store some default values. When I run the application through command prompt it runs ok but when I put it in the NT Task Scheduler the GetSetting fails to retrieve the values and retrieve the blank strings as default values.

    What could be wrong ???

    Thanks in Advance :-)

    Krogoth!

    FSM

  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: GetSetting / SetSetting

    I presume this could be the cause (not sure though)

    The registry key used by VB's function is
    H_key_Current_user\Software\VB and VBA Settings
    and under this your own section & key-value pairs
    This place is meant for "personal" customisation of applications.. hence the name "current_user"!

    On NT, a service runs in system-account and not in any perticular user account.. so this key either is not available OR the values are NULL.

    You can do two things: For example write to a different place
    H_key_Local_machine\Software\Yourcompanyname\YouAppName.. this key is probably available foe the service too. This is not direct. ( i should have some code that implements this as a class.. or check online)

    Or write to a file (ini format, may be)

    ps: In quite a few places in MSDN it is said that it is not advisable to run VB apps as services... so note that you are treading troubled waters


    RK

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured