How to load dll into vbscript?

Author Message
rahul_k

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 1/9/2008
  • Status: offline
How to load dll into vbscript? Thursday, January 10, 2008 5:49 AM (permalink)
0
Hello Team,
I want to load  a dll functions into  script (both vbscript and javascript) for digital signature verification.
I have tried this using CAPICOM dll and it woks well.
I have a custom DLL which has got the  functions which can be used for digital signature creation/verification.
For this i m referring to a vb projects(.bas )in which there are certain  functions are called like
SetErrorMode and LoadLibrary ..
thses functions are from dll kernel32.dll i want to call the same functions into my vbscript and javascript
My first doubt is can we load the dll (kernel32 or so)  into vbscript and javascript embeded within an html page.
and make use of its routine?
Or it is possible only into vbscript and not in javascript??
The functions in my vb projects are something like

  OriginalErrorValue = SetErrorMode(SEM_NOOPENFILEERRORBOX Or SEM_FAILCRITICALERRORS)
  hInst = LoadLibrary(DllName$)
  OriginalErrorValue = SetErrorMode(OriginalErrorValue)

Regards,
Sunita.

 
#1
    centauricw

    • Total Posts : 42
    • Scores: 2
    • Reward points : 0
    • Joined: 2/20/2006
    • Status: offline
    RE: How to load dll into vbscript? Friday, January 11, 2008 1:05 AM (permalink)
    0
    VBScript only supports COM utilities that implement the IUnknown interface for automation.  You can't import functions from a regular non-COM DLL in VBScript.
     
    #2
      Rischip

      • Total Posts : 519
      • Scores: 2
      • Reward points : 0
      • Joined: 3/26/2007
      • Status: offline
      RE: How to load dll into vbscript? Monday, January 14, 2008 10:53 AM (permalink)
      0
      Check out these posts. This should do what you need, but will require you to install the .net runtime for you to compile the example.
      Once you have the activex control compiled and registered then you should be able to do what you are trying to do. I have verified that it works, but it may only work with managed code. I have not tested that yet.

      http://www.visualbasicscript.com/m_50768/mpage_1/key_jscript/tm.htm#50768
      <message edited by Rischip on Monday, January 14, 2008 11:02 AM>
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9