SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Aug 1999
    Location
    Cupertino, CA
    Posts
    2
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How to access data in app through DLL?

    Hi,

    We are trying to access runtime data in the app we're testing from Silk. We tried writing a DLL that exposes the data, but discovered that you can't get to the data since the DLL is loaded in a different process.

    Using the "inprocess" keyword when declaring the DLL in the Silk script doesn't seem to help either.

    Has anybody had any success with this kind of scenario?

    Thanks,
    Terry

  2. #2
    AJ
    AJ is offline
    Moderator AJ's Avatar
    Join Date
    Jun 1999
    Location
    San Jose, CA
    Posts
    1,691
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to access data in app through DLL?

    Terry,

    You may try to download and use the Shared Memory between separate Processes DLL
    by Richard Weth. You can download it from the download section of www.betasoft.com.



    ------------------
    AJ Alhait
    BetaSoft Inc.
    AJ Alhait
    BetaSoft Inc.

  3. #3
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to access data in app through DLL?

    You may need to use the Extension Kit. This requires its purchase from Segue, but the process of building the Extension is usually not too complicated if you have the cooperation of development.

    John Green


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

  4. #4
    Super Member
    Join Date
    Jul 2001
    Location
    Earth
    Posts
    1,882
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to access data in app through DLL?

    Can you post an example of how you declared the DLL function using inprocess?

  5. #5
    Junior Member
    Join Date
    Aug 1999
    Location
    Cupertino, CA
    Posts
    2
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: How to access data in app through DLL?

    ===================================== ===================================== Testcase t - 1 error
    *** Error: Exception in DLL call -- d:\theapp\bin\Tools.dll Occurred in QAP_DO
    Called from t at bond.inc(341)


    The Code:


    *Silk code*
    -----------
    dll "d:\theapp\bin\Tools.dll"
    inprocess INT QAP_DO(String pServerName, int nFunction, String
    pArg)

    testcase t()
    int s = QAP_DO("hi", 5, "thearg")
    print(s)
    String ss = space(1000)
    int i = QAPON(9)
    print(i)


    *C++ Dll code*
    --------------
    extern "C"
    {

    __declspec(dllexport) int QAP_DO(LPCSTR pServerName, int nFunction, LPCSTR pArg)
    {
    return 888;
    }

    };
    ===================================== =====================================

    I've tried all the [out] [inout] combinations when calling the function and it fails to. The reason for the "inprocess" keyword in the dll declaration is so the dll in the Apps address space gets called. I tried it without "inprocess" and it doesn't work because the dll get's loaded in Silk's address space and doesn't have access to the running app's data.


    Another thing is, that if I make the function with no parameters, and it just returns an int, then it works. But if I pass any parameters in, and do nothing with them, the dll call fails. Also, if I try to return a string, it fails as well.

  6. #6
    taa
    taa is offline
    Junior Member
    Join Date
    Aug 1999
    Location
    Sudbury, MA USA
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to access data in app through DLL?

    The "inprocess" keyword assumes that the first argument to the function you're calling is a window handle; that's how it identifies the process in which to invoke the function. If you declare your function with a first argument HWND hIgnore, and call it with a first argument
    MainWin ("Whatever").GetHandle ()
    you should be in much better shape.

  7. #7
    Guest

    Re: How to access data in app through DLL?

    Terry
    Sorry for the delay ..
    If you are still interested in the source for the memory shared dll please send an email to rick_weth@yahoo.com.

    Right now I can share strings and integers .. is that sufficient? By the way for something like this you DON'T need Segue's extension kit. Those clowns at Segue get way too much for stuff like this.

    You should actually be able to get a developer to link in the ipc dll into the C/C++ and code a simple call to get_bb or get_int just like in the example.

    The concept is that you may want to activate this code via a SendMessage (for a reserved QA User code) or a ride on to a MessageHandler for say a keypress.

    Then after the action (SendMessage is Synchronous so you don't need semaphores) you can simply read the contents in the shared segment directly through QAP.

    Also if for some bizarre reason you need to communicate in reverse (QAP -> App under test) simply reverse the procedure and initialize the string/int and trigger the event.

    By the way to Segue User's in general this is an A+ solution, for a simpler solution .. just use the clipboard. Developer's can interface to it very easily and we ALL know how easy it is to pick off the contents of the Clipboard.

    By the way it's real easy to get lists this way by ending each string with /r/n then simply read the clipborad and get your LIST!

    Try it .. youll like it!



 

 

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 10:46 PM.

Copyright BetaSoft Inc.