SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Junior Member
    Join Date
    Aug 2000
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pointers in SilkTest

    Is there any way to use data pointers in SilkTest? As far as I have looked, I can't see a way to use them.

    Mark

  2. #2
    Member
    Join Date
    Dec 1999
    Location
    Columbus, OH
    Posts
    78
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pointers in SilkTest

    What do you want to use them for?

  3. #3
    Member
    Join Date
    Aug 2000
    Location
    Hyderabad,AP,India
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pointers in SilkTest

    Yes Friends I am also very Enthusiaistic to know Whether we can use pointers in Silk or not

  4. #4
    Member
    Join Date
    Dec 1999
    Location
    Columbus, OH
    Posts
    78
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pointers in SilkTest

    I am not sure what you want to use pointers for, but in the case of calling functions from DLL's the following applies towards passing arguments to DLL functions:

    Variable type - How to pass:

    1. Pointer to a character - Pass a 4Test string variable to a DLL which requires a pointer to a character (null terminated).

    2. Pointer to a numerical array - Pass a 4Test array or list of the appropriate type to a DLL which requires a pointer to a numerical array.

    3. Pointer to a record - Pass a 4Test record to a DLL which requires a pointer to a record. If the record has a dwSize field, then you must set it to the size of the record. 4Test records are always passed by reference to a DLL.

    4. Pointer to a function - You cannot pass a pointer to a function to a DLL function.

    5. Null string pointer - To pass a null pointer to a string, use the null keyword in 4Test.

    6. Window handle - Use the hWnd property or the GetHandle method of the AnyWin class to get the window handle you need.

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pointers in SilkTest

    Mostly I like to use pointers to pass functions and variables as arguments to other functions. SilkTest doesn't have an "official" way to do this, but the "reference operator" provides a back door way to do the same thing.
    From SilkTest help:

    "Reference operator
    The reference operator (@expression) lets you refer to functions and variables indirectly, by name. It uses the value of its operand to refer to variable, the fields in a record, function, method, property or child window.
    Example
    INTEGER i = RandInt (1,32)
    @("Test{i}") ()
    This invokes a randomly selected test from the set Test1, Test2,...Test32."
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  6. #6
    Junior Member
    Join Date
    Jul 2000
    Location
    Edmonton, Alberta, Canada
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pointers in SilkTest

    Hi, I am working at the same company as Mark so I got some additional information/questions…
    First, thanks for all the replies!
    What we are trying to do is to use windows messaging to interface with a Delphi data-grid control. We use the SENDMESSAGE API-call. Some messages require string parameters that are supposed to be passed as pointers to strings.
    Questions:
    Tom V. gave an example of passing a DLL a 4Test string variable, does that work with the SENDMESSAGE as well?
    Is there any way of retrieving strings that gets returned from the SENDMESSAGE call? (The function returns a pointer to a string…). We are currently using the clipboard for data sharing between the Delphi controls and Silktest and that feels a bit shaky…

    Thanks again for your time!
    Daniel Grufman QA Eng.
    Total Control

  7. #7
    Member
    Join Date
    Dec 1999
    Location
    Columbus, OH
    Posts
    78
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pointers in SilkTest

    The following example use a DLL function that requires the parameter be a pointer to a structure. I made my own record which mirrors the required structure, and pass it to the function with the keyword "inout". The function does not return anything, but the SYSTEMTIME record is updated with the new values. I don't know if ths will work with SENDMESSAGE, but I hope the example helps.

    Let me know how it works out.

    [This message has been edited by Tom VonderBrink (edited 08-29-2000).]

  8. #8
    Senior Member
    Join Date
    Sep 1999
    Location
    San Jose,CA,USA
    Posts
    340
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pointers in SilkTest

    This is for dgrufman

    I don't think you can actually get anything
    meaningfull from the return (in lParam). It has 'something' to do with the way Windows handles address xlation in return calls. Sometimes (for GetText) you CAN get the information returned. A bunch of times (like SendMessageA) you cannot.

    I used the same process for communicating
    between Stingray Obj Grid and Segue.

    I found the clipboard to be preety reliable.
    I was surprised at how reliable it
    was. Plus the fact that the Clipboard is
    a very very big dynamic memory container.

    If this bothers you you can employ a memory mapped dll (I have one in betasoft downloads).

    However this technique limits how much memory you can share. Also I learned to zero out the clipboard before I made a SendMessageA call to the API I worked out with development. (Or you could intialize it with a string like "null")

    This way if you know that there should be data there (and you are doing a lot of ipc)
    you could detect that the code for delphi grid did not update the clipboard, and have retry logic in your code, to re-read the clipboard (till it gets there)

    Even though it did not happen to often "sometimes" the clipboard would not be updated in time (after the SendMessageA call returned).

    I think this is a very powerfull interface technique you guys worked out, and should be leveraged by the community before the purchase of an extension kit.

    [This message has been edited by rick_weth (edited 08-30-2000).]

    [This message has been edited by rick_weth (edited 08-30-2000).]
    Smoke me a kipper, I'll be back for breakfast!
    Sincerely
    Richard Weth
    Sr. QA Engineer

  9. #9
    Junior Member
    Join Date
    Jul 2000
    Location
    Edmonton, Alberta, Canada
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pointers in SilkTest

    Thanks again for your replies, they have been most helpful.
    We will incorporate the Null-write to the clipboard immediately that was suggested by Rick.
    (The original idea of using the clipboard came from Rick as well )

    A comment/question regarding the shared memory DLL:
    My developer (Yes I “own” them ) tells me that using DLLs to share memory is not a good thing. Microsoft strongly discourages the idea of having several processes accessing a common memory space, all memory should be mapped within the processes own memory space. Any comments? Is this true?
    Daniel Grufman QA Eng.
    Total Control

  10. #10
    Senior Member
    Join Date
    Sep 1999
    Location
    San Jose,CA,USA
    Posts
    340
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pointers in SilkTest

    Actually I would agree with your developer when it comes to SEVERAL processes. However employing memory shareing with two in a half-duplex mode should not be an issue.

    Before you do SendMessageA Silk "owns" the memory mapped dll. So you can stuff info for the AUT there with no potential conflict.

    Then when you do SendMessageA to the AUT .. no problem! Silk isn't "going anywhere". Silk has to wait for the AUT to "finish", to
    the SendMessageA request.

    After that (when Silk regains control) Silk owns the DLL again. So I really do not see a problem. Except that any memory mapped DLL is going to have size limitations. Whereas the Clipboard can just grow.

    A bunch of people think the clipboard is a cheesy solution, I personally like it. BTW congrats on implementing this solution. This is non trivial interface work!!


    Smoke me a kipper, I'll be back for breakfast!
    Sincerely
    Richard Weth
    Sr. QA Engineer

 

 
Page 1 of 2 12 LastLast

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 09:15 AM.

Copyright BetaSoft Inc.