SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    calling routines from .dll

    Hi all:

    I need to call a routine from a DLL with function definition looks something like the following:

    STDMETHODIMP Cregmulti::foobar (BSTR name, BSTR path, BSTR value)

    This function should be called as:
    foobar ("name", "path", "value")

    Can someone please give me an example of how TC would call this routine? Since BSTR is an unsigned short *, so do i have to convert the string of characters to Byte size first? Or TC can take care of the conversion automatically?

    Thanks in advance!!!
    -yue

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    473
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: calling routines from .dll

    Hi,

    Please check this thread from our newsgroups:
    http://www.automatedqa.com/forums/d....em=10129&utag=

    Atanas

  3. #3
    Member
    Join Date
    Aug 2005
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: calling routines from .dll

    Hi Atanas

    Thank you for your posting. But somehow when I try to run the program it says that the function I am trying to call is not found. The MVC++ program works fine when I test it alone. So do you know what I did wrong?

    Thank you!

  4. #4
    Senior Member
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    473
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: calling routines from .dll

    Hi,

    Please make sure the exported function name is correct.
    You can use the Depends tool that is shipped with MS Visual Studio to see the actual function names in your DLL.
    If the names are correct, please send your script and a sample DLL project to our Support Team at support@automatedqa.com - they'll see what's wrong.

    Atanas

  5. #5
    Member
    Join Date
    Aug 2005
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: calling routines from .dll

    Hi Atanas:

    There are several different .DLL file under the .DlL file I have created:
    USER32.DLL
    ADVAPI32.DLL
    KERNEL32.DLL
    WINSPOOL.DRV
    COMCTL32.DLL
    OLE32.DLL
    OLEAUT32.DLL
    GDI32.DLL
    Can you tell me which of these .DLL file is suppose to contain all the functions that I have created? Because I went through all of them and it seems like none of the functions that I declared are in there.

    Thanks in advance!

  6. #6
    Member
    Join Date
    Aug 2005
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: calling routines from .dll

    I have send a copy of my .dll file and the script that i used to support@automatedqa.com. Please help!

    Thanks!

  7. #7
    Member
    Join Date
    Aug 2005
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: calling routines from .dll

    Hi,

    I am still waitting for reply. Please help!

    -yue

  8. #8
    Senior Member
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    473
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: calling routines from .dll

    Hello Yue,

    Our Support Team has already sent you the answer. Here is a quote just in case:

    The DLL Access plug-in allows you to call only the exported functions from DLLs. The reg_setmstr function is not an exported function - it is a method of the Cregmulti class, so it is not possible to call it from script using the DLLAccess plug-in.

    Since your DLL is a COM library, you can easily call the methods of the COM object from script without using the DLLAccess plug-in - just create your COM object in script and call its methods. For example:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"> 'VBScript
    Set RegMultiObj = Sys.OleObject(&quot;PORT80.regmulti.1&quot;, &quot;&quot
    i = RegMultiObj.reg_setmstr(name, path, value) </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
    <font size="2" face="Verdana, Arial, Helvetica">Atanas

  9. #9
    Member
    Join Date
    Aug 2005
    Posts
    95
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: calling routines from .dll

    Hi:

    I used regsvr32 to upload the .dll file and tried the piece of code you had above. But it said that the ole object is not found thou.

    And please send the future response to y17chen@gmail.com because for some reason i did not receive the above email.

    Thank you
    -yue

  10. #10
    Senior Member
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    473
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: calling routines from .dll

    Hi Yue,

    Strange, the code works fine here. Try unregistering the library (regsvr32 <FULL_PATH>\regmulti_com.dll /u) and registering it again.

    If this doesn't help, do the following:

    1. Find this registry branch in Registry Editor:
    HKEY_CLASSES_ROOT\PORT80.regmulti.1\CLSID

    2. Make sure the Default key has this value:
    {C26C21A5-A101-46D0-8454-3764F2005EE2}

    3. Find this branch in Registry Editor:
    HKEY_CLASSES_ROOT\CLSID\{C26C21A5-A101-46D0-8454-3764F2005EE2}\InprocServer32

    4. Make sure that the Default key in this registry branch contains a correct path to the regmulti_com.dll file and that the file exists in that location.

    If this doesn't help you, please let me know the exact error you are getting.

    Atanas

 

 
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
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 12:09 AM.

Copyright BetaSoft Inc.