SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Sep 2001
    Location
    Montreal, Quebec, Canada
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting the PATH environment variable in the agent

    Hi everyone,

    I have implemented a DLL extension to be used in conjunction with our test scripts and it works fine so long as my other DLL dependencies are in the path otherwise I get a message telling the DLL file cannot be found. (not the main DLL, but its dependencies)

    Other than explicitly setting the path in the test script before making a call to one of the DLL functions (this is when it actually gets loaded), is there any way of doing it through SilkTest, 'Agent runtime settings' or something?

    For now I've solved the problem as follows:

    use "mydll.dll"

    ...
    STRING strPath = SYS_GetEnv("PATH")
    SYS_SetPath("PATH", strPath + ";<my dependency DLL path>")
    ThisIsAnExportedDLLCall()

    // setting the path back
    SYS_SetPath("PATH", strPath)

    // subsequent DLL calls are fine since the library has been loaded already

    Thanks for any help,
    Steve Antonakakis

  2. #2
    Junior Member
    Join Date
    Sep 2001
    Location
    Montreal, Quebec, Canada
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting the PATH environment variable in the agent

    a correction to my message, it seems bracket characters are reserved for formatting, here it is again:

    STRING strPath = SYS_GetEnv("PATH")
    SYS_SetPath("PATH", strPath + ";my dependency dll path")
    ThisIsAnExportedDLLCall()

    ------------------

  3. #3
    Senior Member
    Join Date
    Oct 1999
    Location
    Tyngsborough, MA
    Posts
    211
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting the PATH environment variable in the agent

    I don't think there are any other tricks to this one. We've taken a slightly different approach in that we setup our automation machines to have the path we need for using dlls rather than scripting it. Actually, I kind of like your approach better.

    We just did that this week though. I'm wondering now if the path variable is unique for each user?

    Brian

    ------------------

  4. #4
    Junior Member
    Join Date
    Sep 2001
    Location
    Montreal, Quebec, Canada
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Setting the PATH environment variable in the agent

    Thanks for your reply,

    Your question depends on the operating system you're running on. In NT/2000/XP you can set environment variables through Control Panel->System->Environment either for All users or the current user logged in.

    I'm not sure if the same is available in 9x/Me but I would think so if user profiles are supported.

    Hope this helps,
    Steve

    ------------------

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:48 PM.

Copyright BetaSoft Inc.